没办法,约好去玉溪澄江抚仙湖,并且大队人马已经先出发了,我们就在阳光海岸会合吧,房间都已经预定了。
晚上喝茶玩杀人游戏,到凌晨4点多终于熬不住,睡觉。
再发一张照片:云
Month: July 2007
玉溪澄江抚仙湖
获得CPU速度的Delphi 函数
这个有意思,虽然是个老程序了,对于3Ghz的CPU算的还是很准的
function TscSystemInfo.GetCPUSpeed : Double;
const
IntDelayTime = 500; // time in ms
var
TimerHi, TimerLo: DWORD;
IntPriorityClass, IntPriority: Integer;
begin
IntPriorityClass := GetPriorityClass(GetCurrentProcess);
IntPriority := GetThreadPriority(GetCurrentThread);
SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS);
SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL);
Sleep(10);
asm
dw 310Fh
mov TimerLo, eax
mov TimerHi, edx
end;
Sleep(IntDelayTime);
asm
dw 310Fh
sub eax, TimerLo
sbb edx, TimerHi
mov TimerLo, eax
mov TimerHi, edx
end;
SetThreadPriority(GetCurrentThread, IntPriority);
SetPriorityClass(GetCurrentProcess, IntPriorityClass);
Result := TimerLo / (1000.0 * IntDelayTime);
end;