git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14366 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
#include "timer.h"
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Initialization of time
|
||||
* -------------------------------------------------------------------------- */
|
||||
Timer::Timer()
|
||||
{
|
||||
flag = 0;
|
||||
@ -7,6 +9,9 @@ Timer::Timer()
|
||||
return;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* public function, start the timer
|
||||
* -------------------------------------------------------------------------- */
|
||||
void Timer::start()
|
||||
{
|
||||
t1 = clock();
|
||||
@ -15,6 +20,9 @@ void Timer::start()
|
||||
return;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* public function, stop the timer
|
||||
* -------------------------------------------------------------------------- */
|
||||
void Timer::stop()
|
||||
{
|
||||
if ( flag&1 ) {
|
||||
@ -24,6 +32,9 @@ void Timer::stop()
|
||||
return;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* public function, print the total time used after timer stops
|
||||
* -------------------------------------------------------------------------- */
|
||||
void Timer::print()
|
||||
{
|
||||
if ( (flag&3) != 3) return;
|
||||
@ -34,6 +45,9 @@ void Timer::print()
|
||||
return;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* public function, return the total time used up to now, in seconds
|
||||
* -------------------------------------------------------------------------- */
|
||||
double Timer::elapse()
|
||||
{
|
||||
if ( (flag&3) != 3) return 0.;
|
||||
|
||||
Reference in New Issue
Block a user