資源簡介
c++版本的求解15數碼問題算法源代碼2
代碼片段和文件信息
#include?
#ifndef?hr_timer
#include?“hr_time.h“
#define?hr_timer
#endif
double?CStopWatch::LIToSecs(?LARGE_INTEGER?&?L)?{
return?((double)L.QuadPart?/(double)frequency.QuadPart);
}
CStopWatch::CStopWatch(){
timer.start.QuadPart=0;
timer.stop.QuadPart=0;
QueryPerformanceFrequency(?&frequency?);
}
void?CStopWatch::startTimer(?)?{
????QueryPerformanceCounter(&timer.start);
}
void?CStopWatch::stopTimer(?)?{
????QueryPerformanceCounter(&timer.stop);
}
double?CStopWatch::getElapsedTime()?{
LARGE_INTEGER?time;
time.QuadPart?=?timer.stop.QuadPart?-?timer.start.QuadPart;
????return?LIToSecs(?time)?;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????656??2008-09-04?17:58??hr_time.cpp
?????文件?????????323??2008-09-04?17:58??hr_time.h
?????文件???????18000??2008-10-05?10:09??moves.txt
?????文件???????20797??2008-09-17?12:03??puzzle.cpp
?????文件?????????877??2008-10-05?10:09??puzzle.sln
?????文件???????12288??2008-10-05?10:26??puzzle.suo
?????文件????????1300??2008-09-17?11:14??ReadMe.txt
評論
共有 條評論