Created
September 3, 2014 17:18
-
-
Save ifarbod/87740e2ea492fddd33da to your computer and use it in GitHub Desktop.
A Small snippet for testing two ways of loops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <a_samp> | |
#define ITERS (10000000) | |
main() | |
{ | |
new | |
ticks = GetTickCount(); | |
for(new i = 0; i < ITERS; i++) | |
{ | |
// nothing | |
} | |
printf("Took: %d ms", GetTickCount() - ticks); | |
ticks = GetTickCount(); | |
for(new i = ITERS; i != -1; i--) | |
{ | |
// nothing | |
} | |
printf("Took: %d ms", GetTickCount() - ticks); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment