site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com User-agent: Mutt/1.5.9i On Sat, Feb 03, 2007 at 03:24:15AM -0500, Ed Wynne wrote:
On Feb 3, 2007, at 3:03 AM, Jan Brittenson wrote:
Greg wrote:
So then why do I barely see 1% CPU utilization on linux? But how accurate is it? When I last dealt with this a few years ago, nanosleep always slept at least 10ms on Linux. Some quick googling shows this still seems to be the case.
I assume you ment 10us?
10 milliseconds is quite feasible, corrresponds to a timer tick of 100 Hz, which is quite common... Quick test on a 2.4.18 box gives me the following; seems to be running 50 Hz (or is under some load): colin:~$ cat t.cc #include <time.h> int main( int argc, char ** argv ) { timespec t = { 0, 1 }; for ( unsigned i = 0; i < 100; ++i ) ::nanosleep( & t, 0 ); return 0; } colin:~$ g++ -O t.cc colin:~$ time ./a.out real 0m2.002s user 0m0.000s sys 0m0.010s Regards, Colin _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Colin Hirsch