Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include "math.h"
  2. #include "windows.h"
  3.  
  4. int _tmain(int argc, _TCHAR* argv[])
  5. {  
  6.     DWORD start = timeGetTime();
  7.     int i;
  8.     for(i=0;i<50000000;i++)
  9.     {
  10.         float j = i / 100;
  11.     }
  12.     DWORD end = timeGetTime();
  13.     printf("normal time: %f\n",(end - start)*0.001f);
  14.     start = timeGetTime();
  15.     for(i=0;i<50000000;i++)
  16.     {
  17.         float j = i * 0.01f;
  18.     }
  19.     end = timeGetTime();
  20.     printf("multi time: %f",(end - start)*0.001f);
  21.     getchar();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement