From f87627a19ff8bd8390d1117e9380d56a31f8d5e3 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Fri, 5 Apr 2024 10:54:12 +0200 Subject: [PATCH] Using nrn_timeus() everywhere --- src/parallel/bbs.cpp | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/src/parallel/bbs.cpp b/src/parallel/bbs.cpp index 95962ccbe2..15d0d07bb4 100644 --- a/src/parallel/bbs.cpp +++ b/src/parallel/bbs.cpp @@ -11,16 +11,11 @@ #include "bbsrcli.h" #endif -#if defined(HAVE_TMS) && !NRNMPI -#include -#include -#include -static struct tms tmsbuf, tms_start_; -static clock_t starttime; -#endif +static double starttime; extern int nrn_global_argc; extern char** nrn_global_argv; +extern double nrn_timeus(); bool BBSImpl::is_master_ = false; bool BBSImpl::started_ = false; @@ -132,11 +127,7 @@ double BBSImpl::time() { #if NRNMPI return nrnmpi_wtime(); #else -#ifdef HAVE_TMS - return double(times(&tmsbuf)) / 100.; -#else - return 0.; -#endif + return nrn_timeus(); #endif } @@ -493,18 +484,12 @@ void BBSImpl::done() { return; } done_ = true; -#ifdef HAVE_TMS - clock_t elapsed = times(&tmsbuf) - starttime; + double elapsed = nrn_timeus() - starttime; printf("%d tasks in %g seconds. %g seconds waiting for tasks\n", etaskcnt, total_exec_time, worker_take_time); - printf("user=%g sys=%g elapsed=%g %g%%\n", - (double) (tmsbuf.tms_utime - tms_start_.tms_utime) / 100, - (double) (tmsbuf.tms_stime - tms_start_.tms_stime) / 100, - (double) (elapsed) / 100, - 100. * (double) (tmsbuf.tms_utime - tms_start_.tms_utime) / (double) elapsed); -#endif + printf("elapsed=%g\n", elapsed); } void BBSImpl::start() { @@ -512,7 +497,5 @@ void BBSImpl::start() { return; } started_ = 1; -#ifdef HAVE_TMS - starttime = times(&tms_start_); -#endif + starttime = nrn_timeus(); }