chiark / gitweb /
Fix up wait_for_stability delays
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Thu, 9 Jul 2009 18:21:22 +0000 (19:21 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Thu, 9 Jul 2009 18:21:22 +0000 (19:21 +0100)
pctb/pages.c

index 72f9bb4..0c0a79c 100644 (file)
@@ -355,7 +355,7 @@ static void wait_for_stability(Snapshot **output,
          "  last_input=%f previously=%p `%s'\n",
          last_input, previously, doing);
 
-  double min_interval= 25000; /*us*/
+  double min_interval= 0.025; /*us*/
   for (;;) {
     progress_spinner("%s",doing);
     
@@ -363,7 +363,7 @@ static void wait_for_stability(Snapshot **output,
     double this_interval= min_interval - since_last_input;
 
     if (this_interval >= 0)
-      usleep(this_interval);
+      delay(this_interval);
 
     snapshot(output);
 
@@ -376,7 +376,7 @@ static void wait_for_stability(Snapshot **output,
       nidentical=0;
       if (!with_keypress) {
        min_interval *= 3.0;
-       min_interval += 0.5;
+       min_interval += 0.1;
       }
     } else {
       nidentical++;
@@ -389,7 +389,7 @@ static void wait_for_stability(Snapshot **output,
       if (nidentical >= threshold)
        break;
 
-      min_interval += 0.5;
+      min_interval += 0.1;
       min_interval *= 2.0;
     }