WWII stands out as an abnormal period: In 1943 and 1944, more than 40% of GDP was devoted to national defense. Total spending on national defense from 1940 and 1945 was a little over $5 trillion.1 This represents about a quarter of 2018 GDP. (The numbers for 2019 GDP are not final yet.)
To illustrate the magnitude of U.S. spending during WWII, imagine spending $1 million per hour, 24 hours per day, for 365 days. At this pace, it would take 576 years to spend as much as the U.S. did during WWII.2