Skip to content

Instantly share code, notes, and snippets.

@hsienwei
Created August 31, 2016 01:57
Show Gist options
  • Save hsienwei/cfd1bda7a51d336670ec1b2bb9cf72cb to your computer and use it in GitHub Desktop.
Save hsienwei/cfd1bda7a51d336670ec1b2bb9cf72cb to your computer and use it in GitHub Desktop.
在c++中顯示執行ms
clock_t t1, t2;
t1 = clock();
DoSomething();
t2 = clock();
float diff = ((float)(t2 - t1) / 1000000.0F) * 1000;
printf("battle total time : %f \n ", diff);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment