summaryrefslogtreecommitdiff
path: root/src/main/ScheduleInterface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/ScheduleInterface.c')
-rw-r--r--src/main/ScheduleInterface.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c
index 5f549dc1..e267e0b4 100644
--- a/src/main/ScheduleInterface.c
+++ b/src/main/ScheduleInterface.c
@@ -1253,13 +1253,20 @@ int CCTK_SchedulePrintTimesToFile(const char *where, FILE *file)
/* also print total time at the bottom */
if (total_timer >= 0)
{
- CCTK_TimerStopI (total_timer);
+ int total_timer_running = CCTK_TimerIsRunningI(total_timer);
+ if (total_timer_running)
+ {
+ CCTK_TimerStopI (total_timer);
+ }
CCTK_TimerI (total_timer, timerinfo);
CCTKi_SchedulePrintTimerInfo
(timerinfo, NULL, "", "Total time for simulation", file);
/* just in case this is not at termination yet ... */
- CCTK_TimerStartI (total_timer);
+ if (total_timer_running)
+ {
+ CCTK_TimerStartI (total_timer);
+ }
}
return 0;