Advertisement
teknoraver

tz

Mar 1st, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <time.h>
  2.  
  3. /*
  4. $ gcc -Wall -O3 time.c -o time
  5. $ time ./time
  6.  
  7. real    0m7.102s
  8. user    0m2.060s
  9. sys     0m5.040s
  10. $ time TZ=:/etc/localtime ./time
  11.  
  12. real    0m0.952s
  13. user    0m0.948s
  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 < 10000000; i++) {
  23.                 time(&timep);
  24.                 localtime(&timep);
  25.         }
  26.  
  27.         return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement