mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
Merge pull request #65 from hongling0/master
fix: timer will rewind after 194 days
This commit is contained in:
@@ -220,8 +220,8 @@ _gettime(void) {
|
||||
void
|
||||
skynet_updatetime(void) {
|
||||
uint32_t ct = _gettime();
|
||||
if (ct > TI->current) {
|
||||
int diff = ct-TI->current;
|
||||
if (ct != TI->current) {
|
||||
int diff = ct>=TI->current?ct-TI->current:(0xffffff+1)*100-TI->current+ct;
|
||||
TI->current = ct;
|
||||
int i;
|
||||
for (i=0;i<diff;i++) {
|
||||
|
||||
Reference in New Issue
Block a user