/* in timer.h */ #ifndef H_ZLC_TIMER_ #define H_ZLC_TIMER_ 1 typedef struct{ int iseconds; float fseconds; }TIMER; void timer_update(TIMER *timer); #endif /* H_ZLC_TIMER_ */ /* end timer.h */ /* in timer.c */ #include "timer.h" #include /* for clock() */ void timer_update(TIMER *timer) { timer->fseconds = (float)clock()/1000; timer->iseconds = (int)timer->fseconds; return; } /* end timer.c */