??????????????????????????
???????????? ???????[ 2012/11/29 11:28:02 ] ????????
?????????Ч?????????????????——??????Windows????????????????????????????????????????????????y????????????????????????η????????????????????????????????????????????????????
?????????????
??????Windows?????????????Windows 2003 Server?????????????????????????Windows 2003 Server???????????????????????????????P4???????С????????????P4????Windows 2003 Server???????Intel??????????????????????????????????
???????????????????????????????????г??????????????????——???????????????????????????????????????????????????????????????????????????????????У????????????????????????????????????????????????????????????????Windows???????????????????????????Windows????ó??????????????????????????????????????????????????????????ó???????????Χ??
????????????????????????????????????Windows?????????????????????????????????????????????????????????????????????????????????????????????????????Windows?????????в???????????????????????м?????Σ?????????Ч?????????????????????£?????????????ζ???????ó???
????????и???????????Win32????????????漰?????????????QueryPerformanceCount()??QueryPerformanceFrequency()????Intel???У???P II???????Щ??????????Pentiumо??????????????????????Intel???????????64λ??????????????????????????????????????????????????豸??
????64λ?????????????32 bit??????????????20????????????????20-30???????????????32 bit?????????????????????????????64 bit?????????????????Щ??????20???????20??????????63??——?????????????????????????κγ??????????
????????????м?????????????????????????????????????????????????Win32????????C/C++????????????????????????????????????????????????????????????????????д?y??????
typedef struct _BinInt32 { __int32 i32[2];
}
BigInt32; typedef struct _BigInt64 { __int64 i64
;
} BigInt64; typedef union _bigInt { BigInt32 int32val
; ??
BigInt64 int64val
;
}
BigInt
;
????????????????????????????λ???λ???????д__int64?????????32 bit?????
BigInt start_ticks?? end_ticks
;
_asm {
RDTSC mov start_ticks.int32val.i32[0]?? eax
mov start_ticks.int32val.i32[4]?? edx
}
??δ????????Visual Studio .NET 2003????????У????????C/C++???????????????????RDTSC??ReaD Time Stamp Counter??????????????????????????????????????????EAX??EDX???????????????????start_ticks??????????????????????ε?????????????start_ticks?滻??end_ticks?????end_ticks???start_ticks??????????ε???????????????????
???????_int64???????????????printf()????
printf ( "Function used %I64Ld ticks "??
end_ticks.int64val.i64 - start_ticks.int64val.i64 );
Win32????QueryPerformanceCounter()??????????????????????????????????????????????????????????????????0?????????FALSE?????????????????????????Windows??????????????Windows??Intel????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11