Advertisement
teknoraver

time_vdso

Dec 19th, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <time.h>
  2.  
  3. /*
  4.  * $ time ./time
  5.  *
  6.  * real    0m6.183s
  7.  * user    0m1.225s
  8.  * sys     0m4.959s
  9.  * $ export TZ=Europe/Rome
  10.  * $ time ./time
  11.  *
  12.  * real    0m0.444s
  13.  * user    0m0.443s
  14.  * sys     0m0.000s
  15.  */
  16.  
  17. int main(int argc, char *argv[])
  18. {
  19.     int i = 0;
  20.     time_t timep;
  21.  
  22.     for (i = 0; i < 5000000; i++) {
  23.         time(&timep);
  24.         localtime(&timep);
  25.     }
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement