0ad/source/lib/sysdep/win/whrt/tsc.h
janwas cba876b246 bugfixes+cleanup
aken: clean up debug strings
mahaf: use checked/free version of aken depending on config. refactor to
eliminate goto.
hpet: avoid undefined unmap if HPET not found
whrt/*: make sure all counter class data is initialized
whrt: prefer QPC over PMT (it's much faster?!)
winit: add some instrumentation
wutil: win_exe_dir and win_sys_dir shouldn't end in slash. fixed.

This was SVN commit r5116.
2007-05-29 22:39:36 +00:00

45 lines
1.0 KiB
C++

/**
* =========================================================================
* File : tsc.h
* Project : 0 A.D.
* Description : Timer implementation using RDTSC
* =========================================================================
*/
// license: GPL; see lib/license.txt
#ifndef INCLUDED_TSC
#define INCLUDED_TSC
#include "counter.h"
class CounterTSC : public ICounter
{
public:
virtual const char* Name() const
{
return "TSC";
}
virtual LibError Activate();
virtual void Shutdown();
virtual bool IsSafe() const;
virtual u64 Counter() const;
/**
* WHRT uses this to ensure the counter (running at nominal frequency)
* doesn't overflow more than once during CALIBRATION_INTERVAL_MS.
**/
virtual uint CounterBits() const;
/**
* initial measurement of the tick rate. not necessarily correct
* (e.g. when using TSC: cpu_ClockFrequency isn't exact).
**/
virtual double NominalFrequency() const;
};
#endif // #ifndef INCLUDED_TSC