(bind-func clock_scheduler_main_callback
(let ((hz:double 500.0)
(evtlist:SchedEvt{double}* null)
(ft:[void,double]* null)
(scheduler:[i64,double]* null)
(running:i64 1)
(time 0.0)
(err 0)
(i (/ 1.0 hz)))
(lambda ()
(set! scheduler (scheduler_init evtlist ft))
(set! time (clock_clock))
(while (> running 0)
(scheduler time)
(while (< (clock_clock) time) (thread_sleep 0 100000))
(set! time (+ time i))
void)
void)))