MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Wait

Function Wait

Applications/Snake/main.cpp:40–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void Wait(){
41 timespec nTimer;
42 clock_gettime(CLOCK_BOOTTIME, &nTimer);
43
44 time_t elapsed = (nTimer.tv_sec - timer.tv_sec) * 1000000 + (nTimer.tv_nsec - timer.tv_nsec) / 1000;
45
46 if(elapsed < frameWaitTime)
47 usleep(frameWaitTime - elapsed);
48
49 clock_gettime(CLOCK_BOOTTIME, &timer);
50}
51
52std::list<vector2i_t> snake;
53

Callers 2

mainFunction · 0.70
WaitEventMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected