Skip to content

Instantly share code, notes, and snippets.

@ifarbod
Created September 3, 2014 17:18
Show Gist options
  • Save ifarbod/87740e2ea492fddd33da to your computer and use it in GitHub Desktop.
Save ifarbod/87740e2ea492fddd33da to your computer and use it in GitHub Desktop.
A Small snippet for testing two ways of loops
#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