📄 watch.cpp
字号:
// Watch.cpp: implementation of the Watch class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Watch.h"
#include <iostream.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Watch::Watch()
{
begin = end = 0.0;
}
Watch::Watch( clock_t t )
{
cout << "begin...\n";
cout.flush();
begin = (double)t/CLK_TCK;
end = 0.0;
}
void Watch::Start()
{
cout << "begin...\n";
cout.flush();
begin = (double)clock()/CLK_TCK;
}
void Watch::Stop()
{
end = (double)clock()/CLK_TCK;
Show();
}
void Watch::Show()
{
cout << "stop. \nElapsed time:" << (end - begin) << "秒\n\n";
cout.flush();
}
Watch::~Watch()
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -