Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 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<900000000;i++)
  9. {
  10. int j = i / 2;
  11. }
  12. DWORD end = timeGetTime();
  13. printf("normal time: %f\n",(end - start)*0.001f);
  14. start = timeGetTime();
  15. for(i=0;i<900000000;i++)
  16. {
  17. int j = i >> 1;
  18. }
  19. end = timeGetTime();
  20. printf("shift time: %f",(end - start)*0.001f);
  21. getchar();
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement