Quantcast
Channel: User Zan Lynx - Stack Overflow
Viewing all articles
Browse latest Browse all 40

Answer by Zan Lynx for Why this simple C program uses has different cpu usage in Ubuntu and Windows?

$
0
0

There are a couple of things that can cause this.

First, programs that monitor CPU usage report in different ways. Windows Task Manager reports 50% for one entire CPU core at maximum use. Apple's reports 100% per CPU core, so a 8c/16t system reports 1600% usage for all cores at max.

Second, your program spends all of its time doing printf output. That depends on the speed of printf and the speed of the output console. On Windows that's pretty slow. Try speed comparisons while output is directed into a file.


Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>