?? 程序運(yùn)行時間的類(c++).txt
字號:
程序運(yùn)行時間的類(C++)
作者: wmc11111 發(fā)表日期: 2006-05-05 21:22 復(fù)制鏈接
<來自互聯(lián)網(wǎng)>
程序運(yùn)行時間的類(C++)
作者: wmc11111 發(fā)表日期: 2006-05-05 21:22 復(fù)制鏈接
<來自互聯(lián)網(wǎng)>
程序運(yùn)行時間的類(C++)
作者: wmc11111 發(fā)表日期: 2006-05-05 21:22 復(fù)制鏈接
<來自互聯(lián)網(wǎng)>
程序運(yùn)行時間的類(C++)
作者: wmc11111 發(fā)表日期: 2006-05-05 21:22 復(fù)制鏈接
<來自互聯(lián)網(wǎng)>
程序運(yùn)行時間的類(C++)
作者: wmc11111 發(fā)表日期: 2006-05-05 21:22 復(fù)制鏈接
<來自互聯(lián)網(wǎng)>
#include <ctime>
#include <iostream>
using namespace std;
class Timer
{
public:
Timer();
double elasped_time();
void reset();
void print();
private:
clock_t start_time;
double time;
};
Timer::Timer()
{
start_time = clock();
}
double Timer::elasped_time()
{
clock_t end_time = clock();
return ((double)(end_time - start_time))/((double)CLOCKS_PER_SEC);
}
void Timer::reset()
{
start_time = clock();
}
void Timer::print()
{
double time = elasped_time();
cout <<endl;
cout <<"耗時-" <<time <<"-秒." <<endl;
}
int main()
{
Timer myTimer;
for(int i = 10000; i > 0; i--)
{
cout <<i <<endl;
}
myTimer.print();
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -