コード例 #1
0
void EvaluateProcessTimes(int* for_sort_, int __size__, void Sort(int* arr, int _size_))
{
    HANDLE hwnd;
    hwnd = GetCurrentProcess(); // current process handle
	ULONG64 start_time, end_time;
	QueryProcessCycleTime(hwnd, &start_time);

	/** <the time that I want to evalute with certain process> **/
	Sort(for_sort_, __size__);
    /***/
	QueryProcessCycleTime(hwnd, &end_time);
    printf("%12llu cycles\n", end_time - start_time);
}
コード例 #2
0
ファイル: Windows.cpp プロジェクト: Velmarin/Gull
sint64 get_time() {
#ifdef CPU_TIMING
#ifndef TIMING
    if (CpuTiming) {
#endif
        uint64 ctime;
        QueryProcessCycleTime(GetCurrentProcess(), &ctime);
#ifdef TIMING
        return ctime / (CyclesPerMSec / 1000);
#endif
        return (ctime / CyclesPerMSec);
#ifndef TIMING
    } 
#endif    
#endif    
    return GetTickCount();
}