#include <iostream>
#include <ctime>
using namespace std;

class stopwatch {
	clock_t startTime;
	clock_t endTime;
public:
	stopwatch();
	stopwatch(clock_t starttime);
	void stop();
	void start();
	void show();
	~stopwatch();
};

stopwatch::stopwatch()
{
	startTime = endTime = 0;
}
stopwatch::stopwatch(clock_t starttime)
{
	this->startTime = starttime;
	this->endTime = 0;
}
	
void stopwatch::start()
{
	this->startTime = clock();
}

void stopwatch::stop()
{
	this->endTime = clock();
}
void stopwatch::show()
{
	int timespan = (endTime - startTime) / CLOCKS_PER_SEC;
	cout << "経過時間: " << timespan << "\n";
}

stopwatch::~stopwatch()
{
}

int main()
{
	stopwatch sw;
	char c;
	
	//遅延...
	sw.start();
	cout << "なにか入力: ";
	cin >> c;
	sw.stop();
	sw.show();
	
	stopwatch sw2(clock());
	cout << "なにか入力。: ";
	cin >> c;
	sw2.stop();
	sw2.show();
	
	return 0;
}