aboutsummaryrefslogtreecommitdiffstats
path: root/src/rtctimer.c
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2002-10-31 23:26:20 +0000
committervektor <devnull@localhost>2002-10-31 23:26:20 +0000
commit28b1aaa5464c4c35e8d77d8ca63e911175f92fd4 (patch)
tree834e8df09edfa543ac9c5aeacc00e0ce9742c032 /src/rtctimer.c
parent99a14d23e51d01d068c5d9c527767849c430094e (diff)
Huge smoothness improvement. Frames are now scheduled to be displayed at
more correct times. This should really help out our quality.
Diffstat (limited to 'src/rtctimer.c')
-rw-r--r--src/rtctimer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rtctimer.c b/src/rtctimer.c
index 7ab8583..d0e2d61 100644
--- a/src/rtctimer.c
+++ b/src/rtctimer.c
@@ -36,6 +36,7 @@ struct rtctimer_s
int current_hz;
int rtc_running;
int verbose;
+ int usecs;
};
rtctimer_t *rtctimer_new( int verbose )
@@ -65,6 +66,7 @@ rtctimer_t *rtctimer_new( int verbose )
rtctimer->rtc_running = 0;
rtctimer->current_hz = 0;
+ rtctimer->usecs = 0;
return rtctimer;
}
@@ -122,6 +124,8 @@ int rtctimer_set_interval( rtctimer_t *rtctimer, int hz )
}
rtctimer->current_hz = hz;
+ rtctimer->usecs = (int) ( ( ( 1000.0 * 1000.0 ) / hz ) + 0.5 );
+ fprintf( stderr, "usecs is %d\n", rtctimer->usecs );
if( restart ) {
rtctimer_start_clock( rtctimer );
@@ -163,6 +167,11 @@ int rtctimer_stop_clock( rtctimer_t *rtctimer )
return was_running;
}
+int rtctimer_get_usecs( rtctimer_t *rtctimer )
+{
+ return rtctimer->usecs;
+}
+
int set_realtime_priority( int max )
{
struct sched_param schp;

Privacy Policy