[vlc-commits] timer: speed up test case

Rémi Denis-Courmont git at videolan.org
Mon Jul 13 21:03:44 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 13 21:59:54 2015 +0300| [35664fc827a235c9da796d83cea90479e6c6dbab] | committer: Rémi Denis-Courmont

timer: speed up test case

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=35664fc827a235c9da796d83cea90479e6c6dbab
---

 src/test/timer.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/test/timer.c b/src/test/timer.c
index 69f2b18..1ce746c 100644
--- a/src/test/timer.c
+++ b/src/test/timer.c
@@ -22,13 +22,14 @@
 # include "config.h"
 #endif
 
-#include <vlc_common.h>
-
 #include <stdio.h>
 #include <stdlib.h>
 #undef NDEBUG
 #include <assert.h>
 
+#include <vlc_common.h>
+#undef msleep
+
 struct timer_data
 {
     vlc_timer_t timer;
@@ -58,8 +59,8 @@ int main (void)
     assert (val == 0);
 
     /* Relative timer */
-    vlc_timer_schedule (data.timer, false, 1, CLOCK_FREQ / 10);
-    msleep (CLOCK_FREQ);
+    vlc_timer_schedule (data.timer, false, 1, CLOCK_FREQ / 100);
+    msleep (CLOCK_FREQ / 10);
     vlc_mutex_lock (&data.lock);
     data.count += vlc_timer_getoverrun (data.timer);
     printf ("Count = %u\n", data.count);
@@ -71,8 +72,8 @@ int main (void)
     /* Absolute timer */
     mtime_t now = mdate ();
 
-    vlc_timer_schedule (data.timer, true, now, CLOCK_FREQ / 10);
-    msleep (CLOCK_FREQ);
+    vlc_timer_schedule (data.timer, true, now, CLOCK_FREQ / 100);
+    msleep (CLOCK_FREQ / 10);
     vlc_mutex_lock (&data.lock);
     data.count += vlc_timer_getoverrun (data.timer);
     printf ("Count = %u\n", data.count);



More information about the vlc-commits mailing list