Make sure the check latency can't be negative.

This commit is contained in:
Gunnar Beutner 2013-09-12 11:36:31 +02:00
parent eb20b7e33e
commit f418db79d7
1 changed files with 6 additions and 1 deletions

View File

@ -837,5 +837,10 @@ double Service::CalculateLatency(const Dictionary::Ptr& cr)
schedule_end = cr->Get("schedule_end");
}
return (schedule_end - schedule_start) - CalculateExecutionTime(cr);
double latency = (schedule_end - schedule_start) - CalculateExecutionTime(cr);
if (latency < 0)
latency = 0;
return latency;
}