MCPcopy Create free account
hub / github.com/cuberite/cuberite / Execute

Method Execute

src/Server.cpp:76–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75
76void cServer::cTickThread::Execute(void)
77{
78 cTimer Timer;
79
80 long long msPerTick = 50;
81 long long LastTime = Timer.GetNowTime();
82
83 while (!m_ShouldTerminate)
84 {
85 long long NowTime = Timer.GetNowTime();
86 float DeltaTime = (float)(NowTime-LastTime);
87 m_ShouldTerminate = !m_Server.Tick(DeltaTime);
88 long long TickTime = Timer.GetNowTime() - NowTime;
89
90 if (TickTime < msPerTick)
91 {
92 // Stretch tick time until it's at least msPerTick
93 cSleep::MilliSleep((unsigned int)(msPerTick - TickTime));
94 }
95
96 LastTime = NowTime;
97 }
98}
99
100
101

Callers

nothing calls this directly

Calls 9

GetNowTimeMethod · 0.80
sizeMethod · 0.80
beginMethod · 0.80
UnlockMethod · 0.80
endMethod · 0.80
NotifyWriteMethod · 0.80
clearMethod · 0.80
TickMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected