2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef TIME_COMPUTER_H
6 #define TIME_COMPUTER_H
9 #include <SupportDefs.h>
15 void Init(float frameRate
, bigtime_t realBaseTime
);
16 void SetFrameRate(float frameRate
);
18 void AddTimeStamp(bigtime_t realTime
, uint64 frames
);
20 bigtime_t
RealTime() const { return fRealTime
; }
21 bigtime_t
PerformanceTime() const
22 { return fPerformanceTime
; }
23 double Drift() const { return fDrift
; }
26 static const int32 kEntryCount
= 32;
30 bigtime_t performanceTime
;
34 void _AddEntry(bigtime_t realTime
,
35 bigtime_t performanceTime
);
39 bigtime_t fPerformanceTime
;
42 double fUsecsPerFrame
;
43 bigtime_t fPerformanceTimeBase
;
46 Entry fEntries
[kEntryCount
];
52 #endif // TIME_COMPUTER_H