aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Content.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Content.c b/src/Content.c
index 517202f..4f7526d 100644
--- a/src/Content.c
+++ b/src/Content.c
@@ -511,15 +511,18 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data)
strcpy(message,"<li>Estimated time to completion:<UL> ");
- if (cctk_final_time<cctk_initial_time)
+ if (cctk_final_time < cctk_initial_time)
{
- seconds = (cctk_itlast-cctkGH->cctk_iteration)*CCTK_RunTime()/
- cctkGH->cctk_iteration;
+ seconds = cctk_itlast - cctkGH->cctk_iteration;
}
else
{
- seconds = (cctk_final_time-cctkGH->cctk_time)/cctkGH->cctk_delta_time*
- CCTK_RunTime()/cctkGH->cctk_iteration;
+ seconds = (cctk_final_time - cctkGH->cctk_time) / cctkGH->cctk_delta_time;
+ }
+ seconds *= CCTK_RunTime();
+ if (cctkGH->cctk_iteration)
+ {
+ seconds /= cctkGH->cctk_iteration;
}
minutes = seconds/60;