Update: Removal of nanosleep when ran in test mode
@@ -438,7 +438,10 @@ void YAN_Pong2(long iterations)
}
batX=MAX(-batWidth*2,MIN(szX-1+batWidth,batX+batVX*batWidth/2));
printf("Hits=%d misses=%d ratio=%f time=%ld\n", hits, misses, (float) (((float) hits) / ((float) hits + misses)), currentTime);
+ if(iterations == -1)
+ {
nanosleep((struct timespec[]){{0, 20000000L}}, NULL); //POSIX sleep
+ }
//YAN_Cycles(10);
}
}
@@ -566,7 +569,10 @@ void YAN_Pong(long iterations)
}
batX=MAX(0,MIN(szX-1,batX+batVX*batWidth/2));
printf("Hits=%d misses=%d ratio=%f time=%ld\n", hits, misses, (float) (((float) hits) / ((float) hits + misses)), currentTime);
+ if(iterations == -1)
+ {
nanosleep((struct timespec[]){{0, 20000000L}}, NULL); //POSIX sleep
+ }
//YAN_Cycles(10);
}
}
