timeval: Use monotonic time where appropriate.
[openvswitch] / tests / test-timeval.c
index 533f81aed3ff87e7e236628cb237d9ff800df591..f0552f88135fb0d4eac17235c84d0d4e113afb26 100644 (file)
@@ -48,10 +48,11 @@ do_test(void)
      * setitimer()).  Then ensure that, if time has really advanced by
      * TIME_UPDATE_INTERVAL, then time_msec() reports that it advanced.
      */
-    long long int start_time_msec;
+    long long int start_time_msec, start_time_wall;
     long long int start_gtod;
 
     start_time_msec = time_msec();
+    start_time_wall = time_wall_msec();
     start_gtod = gettimeofday_in_msec();
     for (;;) {
         /* Wait up to 1 second.  Using select() to do the timeout avoids
@@ -70,6 +71,7 @@ do_test(void)
 
         if (gettimeofday_in_msec() - start_gtod >= TIME_UPDATE_INTERVAL) {
             assert(time_msec() - start_time_msec >= TIME_UPDATE_INTERVAL);
+            assert(time_wall_msec() - start_time_wall >= TIME_UPDATE_INTERVAL);
             break;
         }
     }