janwas
7a5655edde
cpu.cpp: avoided the need for wrapper functions by calling the OS-specific function directly (declared in central header, implemented in the platform's cpp file) avoid the need for init in cpu and ia32 via if(!init) Init() pattern. optimized memcpy now requires SSE support remove error-prone CAS macro; replace with cpu_CAS config: no longer require inline asm for float->int conversions lib_error: remove special-case in CHECK_ERR for windows (no longer needed) This was SVN commit r5365.
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
/**
|
|
* =========================================================================
|
|
* File : tgt.h
|
|
* Project : 0 A.D.
|
|
* Description : Timer implementation using timeGetTime
|
|
* =========================================================================
|
|
*/
|
|
|
|
// license: GPL; see lib/license.txt
|
|
|
|
#ifndef INCLUDED_TGT
|
|
#define INCLUDED_TGT
|
|
|
|
#include "counter.h"
|
|
|
|
class CounterTGT : public ICounter
|
|
{
|
|
public:
|
|
virtual const char* Name() const
|
|
{
|
|
return "TGT";
|
|
}
|
|
|
|
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;
|
|
|
|
/**
|
|
* actual resolution [s]
|
|
**/
|
|
virtual double Resolution() const;
|
|
};
|
|
|
|
#endif // #ifndef INCLUDED_TGT
|