Merge pull request #65 from hongling0/master

fix: timer will rewind after 194 days
This commit is contained in:
云风
2014-02-18 19:44:02 +08:00

View File

@@ -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++) {