Commit 35664fc8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

timer: speed up test case

parent 81705747
...@@ -22,13 +22,14 @@ ...@@ -22,13 +22,14 @@
# include "config.h" # include "config.h"
#endif #endif
#include <vlc_common.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#undef NDEBUG #undef NDEBUG
#include <assert.h> #include <assert.h>
#include <vlc_common.h>
#undef msleep
struct timer_data struct timer_data
{ {
vlc_timer_t timer; vlc_timer_t timer;
...@@ -58,8 +59,8 @@ int main (void) ...@@ -58,8 +59,8 @@ int main (void)
assert (val == 0); assert (val == 0);
/* Relative timer */ /* Relative timer */
vlc_timer_schedule (data.timer, false, 1, CLOCK_FREQ / 10); vlc_timer_schedule (data.timer, false, 1, CLOCK_FREQ / 100);
msleep (CLOCK_FREQ); msleep (CLOCK_FREQ / 10);
vlc_mutex_lock (&data.lock); vlc_mutex_lock (&data.lock);
data.count += vlc_timer_getoverrun (data.timer); data.count += vlc_timer_getoverrun (data.timer);
printf ("Count = %u\n", data.count); printf ("Count = %u\n", data.count);
...@@ -71,8 +72,8 @@ int main (void) ...@@ -71,8 +72,8 @@ int main (void)
/* Absolute timer */ /* Absolute timer */
mtime_t now = mdate (); mtime_t now = mdate ();
vlc_timer_schedule (data.timer, true, now, CLOCK_FREQ / 10); vlc_timer_schedule (data.timer, true, now, CLOCK_FREQ / 100);
msleep (CLOCK_FREQ); msleep (CLOCK_FREQ / 10);
vlc_mutex_lock (&data.lock); vlc_mutex_lock (&data.lock);
data.count += vlc_timer_getoverrun (data.timer); data.count += vlc_timer_getoverrun (data.timer);
printf ("Count = %u\n", data.count); printf ("Count = %u\n", data.count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment