fix uptime and cycles

This commit is contained in:
reccetear 2017-05-18 23:26:07 +08:00
parent 98d189a8d1
commit e1d3ac6abb
1 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ ulong npc_cycles = 0;
ulong _uptime(){
ulong low = GetCount(0);
unsigned long long high = GetCount(1) + 1;
high = (high * 0xffffffff) >> 3;
high = high << 29;
npc_time = (ulong)high / HZ + ((low / HZ) >> 3);
return npc_time;
}
@ -23,7 +23,7 @@ ulong _uptime(){
ulong _cycles(){
u32 low = GetCount(0);
unsigned long long high = GetCount(1) + 1;
high = (high * 0xffffffff) >> 3;
high = high << 29;
npc_cycles = (ulong)high + (low >> 3);
return npc_cycles;
}