All pastes #157407 Raw Edit

Stuff

public text v1 · immutable
·published 2006-09-01 15:36 UTC
rendered paste body
/* 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 <time.h> /* for clock() */

void timer_update(TIMER *timer)
{
  timer->fseconds = (float)clock()/1000;
  timer->iseconds = (int)timer->fseconds;
  
  return;
}

/* end timer.c */