time.cpp
来自「一个将binary转化为cpp的转换程序」· C++ 代码 · 共 46 行
CPP
46 行
/*************************************************************************** * Filename : Time.cpp * Started : 10/??/04 * Copyright: (C) 2004 Christian Petri * Email : viperb0y@users.sourceforge.net * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/#include <sys/time.h>#include <cstdlib>#include "Time.h"Time::Time(){}Time::~Time(){}void Time::start(){ gettimeofday(&now, NULL); clock_s = (now.tv_sec) * 1000 + (now.tv_usec )/ 1000;}void Time::stop(){ gettimeofday(&now, NULL); clock_e = (now.tv_sec) * 1000 + (now.tv_usec )/ 1000;}float Time::result(){ return static_cast<float>((clock_e - clock_s) / 1000);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?