git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14366 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-12-15 15:59:01 +00:00
parent 75de12f26a
commit 5f802f86b5
10 changed files with 399 additions and 543 deletions

View File

@ -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.;