Skip to content

Instantly share code, notes, and snippets.

@josephg
Created January 1, 2012 01:52
Show Gist options
  • Save josephg/1545944 to your computer and use it in GitHub Desktop.
Save josephg/1545944 to your computer and use it in GitHub Desktop.
Running the chipmunk benchmarks in C
void runBenchmarks(void){
for(int i = 0; i < bench_count; i++){
{
int i = 16;
ChipmunkDemo bench = bench_list[i];
printf("%s\n", bench.name);
fflush(stdout);
bench.initFunc();
CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
for(int s = 0; s < 200; s++){
bench.updateFunc(1.0f/60);
}
CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
printf("Done %s in %f ms\n", bench.name, (end - start) * 1000);
fflush(stdout);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment