// // Programmer: Craig Stuart Sapp // Creation Date: Mon Oct 13 11:34:57 GMT-0800 1997 // Last Modified: Tue Feb 10 21:05:19 GMT-0800 1998 // Last Modified: Sat Sep 19 15:56:48 PDT 1998 // Filename: .../sig/code/control/SigTimer/SigTimer.h // Syntax: C++ // $Smake: cc -g -c %b.cc && rm -f %b.o // #ifndef _SIGTIMER_H_INCLUDED #define _SIGTIMER_H_INCLUDED #ifdef VISUAL #include typedef LONGLONG int64bits; #else typedef long long int int64bits; #endif class SigTimer { public: SigTimer (void); SigTimer (int aSpeed); SigTimer (SigTimer& aTimer); ~SigTimer (); static int64bits clockCycles (void); int expired (void) const; static int getCpuSpeed (void); double getPeriod (void) const; double getPeriodCount (void) const; int getTicksPerSecond (void) const; int getTime (void) const; double getTimeInSeconds (void) const; int getTimeInTicks (void) const; int measureCpuSpeed (int quantize = 0) const; void reset (void); static void setCpuSpeed (int aSpeed); void setPeriod (double aPeriod); void setTempo (double beatsPerMinute); void setTicksPerSecond (int aTickRate); void start (void); void sync (SigTimer& aTimer); void update (void); void update (int periodCount); protected: static int64bits globalOffset; static int cpuSpeed; int64bits offset; int ticksPerSecond; double period; // protected functions double getFactor (void) const; }; #endif _SIGTIMER_H_INCLUDED