Created
July 26, 2011 17:49
-
-
Save martani/1107347 to your computer and use it in GitHub Desktop.
nanosleep(), usleep() and sleep() benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./time | |
Call to nsleep(970000) took 970149 | |
Call to usleep(970000) took 970143 | |
Call to sleep(1) took 1000154 | |
$ ./time | |
Call to nsleep(970000) took 970105 | |
Call to usleep(970000) took 970169 | |
Call to sleep(1) took 1000142 | |
$ ./time | |
Call to nsleep(970000) took 970150 | |
Call to usleep(970000) took 970077 | |
Call to sleep(1) took 1000129 | |
$ ./time | |
Call to nsleep(970000) took 970136 | |
Call to usleep(970000) took 970092 | |
Call to sleep(1) took 1000183 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment