MCPcopy Create free account
hub / github.com/TASEmulators/fceux / SpeedThrottle

Function SpeedThrottle

fceux-server/throttle.cpp:85–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void SpeedThrottle(void)
86{
87 static uint64 ttime,ltime;
88
89 waiter:
90 ttime=GetCurTime();
91
92 if( (ttime-ltime) < (tfreq/desiredfps) )
93 {
94 usleep(1000);
95 goto waiter;
96 }
97 if( (ttime-ltime) >= (tfreq*4/desiredfps))
98 ltime=ttime;
99 else
100 ltime+=tfreq/desiredfps;
101}
102

Callers 1

mainFunction · 0.70

Calls 1

GetCurTimeFunction · 0.70

Tested by

no test coverage detected