aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Timer.h
blob: 8bea39d4284eba35af6e56540dd5ac36d98f645e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

class Timer
{
private:
	static const int MAX_TICKS_PER_UPDATE = 10;

public:
    float ticksPerSecond;

private:
    double lastTime;
public:
	int ticks;
    float a;
    float timeScale;
    float passedTime;

private:
    int64_t lastMs;
    int64_t lastMsSysTime;
    int64_t accumMs;

	double adjustTime;

public:
	Timer(float ticksPerSecond);
    void advanceTime();
    void advanceTimeQuickly();
    void skipTime();
};