update phana tool for USER-PHONON from github

This commit is contained in:
Axel Kohlmeyer
2020-07-29 10:48:04 -04:00
parent 29c50671da
commit 7df8a63045
19 changed files with 5398 additions and 4895 deletions

View File

@ -4,9 +4,10 @@
* -------------------------------------------------------------------------- */
Timer::Timer()
{
flag = 0;
start();
return;
flag = 0;
start();
return;
}
/* -----------------------------------------------------------------------------
@ -14,10 +15,9 @@ return;
* -------------------------------------------------------------------------- */
void Timer::start()
{
t1 = clock();
flag |= 1;
return;
t1 = clock();
flag |= 1;
return;
}
/* -----------------------------------------------------------------------------
@ -25,11 +25,11 @@ return;
* -------------------------------------------------------------------------- */
void Timer::stop()
{
if ( flag&1 ) {
t2 = clock();
flag |= 2;
}
return;
if ( flag&1 ) {
t2 = clock();
flag |= 2;
}
return;
}
/* -----------------------------------------------------------------------------
@ -37,12 +37,12 @@ return;
* -------------------------------------------------------------------------- */
void Timer::print()
{
if ( (flag&3) != 3) return;
if ( (flag&3) != 3) return;
cpu_time_used = ((double) (t2 - t1)) / CLOCKS_PER_SEC;
printf("Total CPU time used: %g seconds.\n", cpu_time_used);
cpu_time_used = ((double) (t2 - t1)) / CLOCKS_PER_SEC;
printf("Total CPU time used: %g seconds.\n", cpu_time_used);
return;
return;
}
/* -----------------------------------------------------------------------------
@ -50,6 +50,6 @@ return;
* -------------------------------------------------------------------------- */
double Timer::elapse()
{
if ( (flag&3) != 3) return 0.;
else return ((double) (t2 - t1)) / CLOCKS_PER_SEC;
if ( (flag&3) != 3) return 0.;
else return ((double) (t2 - t1)) / CLOCKS_PER_SEC;
}