In general, when people talk about their computer being slow, I mention dust. As a former computer tech with 15 years of professional experience, I found that simply blowing out dust can significantly improve performance.
I'm not talking about a thin, almost imperceptible amount of dust, but rather large clumps or even mats that prevent normal airflow. I've seen heat sinks that had basically a filter over them that was dust, rather than an actual filter. This blocks a very significant amount of air from ever cooling the CPU. Removing dust like this will tend to quiet fans instantly and allow your components to survive longer. Heat had killed many a computer I was asked to fix.
Going along with the heat issue idea, you might also try better thermal paste. The white cr@p most processors come with is like the Yugo of thermal paste. I use Arctic Silver, but there's better stuff than that, even. Arctic Silver is about a Porche (using the car rating scale), but there are Ferrari's and supercar varieties out there.
Processors tend to slow down when they are overheating. This is a physical thing as well as a "self preservation" programmed into many CPUs. I don't know if it'll still show 100% on the Task Manager or if it'll show 40% (like you see), but it can be a significant slowdown while the CPU tries to let the heat sink and fan "catch up."
Another thing that could be slowing your CPU down is the GPU. If you are running graphic intensive games or utilities (like CAD), your GPU might be holding back your CPU. Getting a better video card might be something to look at. Also, using the wrong right card might be holding you back. Gaming cards aren't (usually) designed to work with CAD as well as workstation cards, and workstation cards (usually) won't game very well, either. Some do, but most don't.
As @Jaroslav Kucera mentioned, it could be disk related. Hitting the HD(s) a lot can slow you way down. I normally run multiple drives. One dedicated to the OS and other(s) for software, Windows page file, personal files, etc. Besides not having to worry so much about backing personal data up in case of OS failure, having multiple HDs spreads the workload considerably. Reading and writing to the same disk at the same time can seriously slow down the HD. Using SHDs can mitigate this, but not entirely. Photoshop and video editing software are known to hit HDs hard. Reading from one HD then outputting to a 2nd HD is the way to go. This also helps the life of your HDs. I also go with active cooling on my HDs. I haven't killed a hard drive since I put a fan and heat sink on them +15 years ago. Google them, they are cheap insurance.
Believe it or not, your PSU might be slowing you down, too. If you don't have enough power (or your PSU is old or a cheap, over rated, Chinese POS), you can have performance issues. I've seen first hand what odd OS issues a flaky PSU can do. You are looking for voltage as well as amps, so make sure they all match the specs on the PSU, if you go this route, and also make sure they meet or exceed your power needs. If your components total 500 watts and you're giving them even 475, that's bad. I recommend going over your requirements by about 20%, so as your PSU gets older (and drops power) and your other components get older (and require mote power), you aren't stuck buying a new PSU so quickly.
Including the other answers here, there are still more reasons for your computer to run slow. Except for the PSU option, what I talked about were very commonly seen when I was a computer tech. Doing a benchmark and other tests are the only way you'll be able to figure things out. Swapping parts might not even solve the issue if it's a combo of multiple parts causing the slowdown.
And, AFAIK, there's no way to force your computer to use 100% of the processor. The CPU and OS knows what they need to do and are really good at their jobs, usually. :-) I don't think anyone has yet figured out a way to force feed a CPU to make it run at 100% when you think it should. At least not without feeding it extra junk to make the percentage "look good."
With you seeing 40% and not and a whole number division of 100% (like 25%, 33%, or 50%), I have a feeling it's not a single threading issue. It could be, but that's not where my mind goes. +1 to @Twisty Impersonator for bringing it up right away, though.
Good luck trying to figure this one out! I've spend days trying to figure this kind of thing out, only to end up replacing most of the guts as a "last resort."
1An application is only going to use the resources it requires. – Ramhound – 2017-11-02T11:49:37.263
@Ramhound, but it's being laggy, so it must require more, correct? – Nhu Thai Sanh Nguyen – 2017-11-02T11:52:30.477
Use an CPU stress tool an check if the CPU run at 100%. (https://www.mersenne.org/download/)
– Joe6pack – 2017-11-02T11:52:53.9604I understand what OP is getting at, I despise how when antivirus or windows update is running it completely bogs my system down, maxing out that one single core....leaving the rest of them to do what? I end up sitting for 12 minutes until I can get back to work. – None – 2017-11-02T14:11:51.627
10Any application that maxes out even one of the several shared resources in a computer (CPU, storage, memory, or network) can make the entire system slow, despite the remaining shared resources having unused capacity. – I say Reinstate Monica – 2017-11-02T15:12:50.850
78I've been programming for 25 years. And I can assure you - this is not a conspiracy. Its rare to find applications where the CPU is the bottleneck, most of the time applications are waiting on other things like the hard drive, RAM, or network. – Contango – 2017-11-02T15:51:38.410
10Suppose you are doing some computational work -- doing your taxes, lets say. If you do zero work while you are waiting for your tax forms to arrive in the mail then you will do zero work for a long, long time. Laggy apps are often badly written; they block the UI thread on high-latency operations like disk or network IO that have nothing to do with the CPU, and so the CPU is idle and the app is unresponsive. Getting a faster CPU doesn't help; that just gets you to the blocking high latency operations faster. – Eric Lippert – 2017-11-02T16:52:55.653
@EricLippert This happens to me all the time when I'm driving. Except it's people with their fast cars that get to the stoplight before I do. – I say Reinstate Monica – 2017-11-02T16:59:20.983
3@TwistyImpersonator: That is a good analogy for high-contention multithreaded programs. We sometimes see that a multithreaded program will run slower on a faster CPU because the CPU is getting more threads into a blocked state faster than a slower CPU would. If every driver in New York City was given a 10x faster car tomorrow, commute times would not improve. They would get worse. – Eric Lippert – 2017-11-02T17:17:08.370
I suggest making sure all drivers, especially chipset drivers, are up to date to make sure the OS is interacting well with your hardware. – Derkooh – 2017-11-02T19:09:48.030
Heck, just read what these people monitored and optimized through!!
https://medium.com/netflix-techblog/serving-100-gbps-from-an-open-connect-appliance-cdb51dda3b99
1@SiXandSeven8ths Hard drive seek time is almost certainly your problem in the case where you are experiencing an unresponsive system during virus scan. Buy an SSD, you will never regret it. – trognanders – 2017-11-03T18:49:48.373
@BaileyS, I have SSDs. Resource hogging Malwarebytes and Windows Defender are the culprits. Scanning is a bitch apparently. Firefox and Chrome crap things up from time to time too. Fresh Windows install. Older hardware though. – None – 2017-11-03T19:16:06.307
1As an aside, in any multitasking operating system, it is literally impossible for the actual usage to be 100%, because things like drivers, interrupts, messages, task switching, and so on will consume some part of your processing power. Windows, at least, seems to report 1-2% CPU usage for itself, so hypothetically you'd see at best 99% usage even if the program could use all the cores and threads available in hardware. – phyrfox – 2017-11-03T20:22:46.723