changeset 4400:1187542d84d8

usleep() accurancy tester
author arpi
date Mon, 28 Jan 2002 23:46:42 +0000
parents a4098aec828a
children 8d00348d0d6b
files TOOLS/usleep-test.c
diffstat 1 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TOOLS/usleep-test.c	Mon Jan 28 23:46:42 2002 +0000
@@ -0,0 +1,26 @@
+
+main(){
+int u;
+
+for(u=0;u<30000;u+=500){
+    unsigned int x[9];
+    int i;
+    x[0]=GetTimer();
+    for(i=1;i<=8;i++){
+	usleep(u);
+	x[i]=GetTimer();
+    }
+    printf("%d -> %d %d %d %d %d %d %d %d\n",u,
+	x[1]-x[0],
+	x[2]-x[1],
+	x[3]-x[2],
+	x[4]-x[3],
+	x[5]-x[4],
+	x[6]-x[5],
+	x[7]-x[6],
+	x[8]-x[7]
+	);
+}
+
+
+}