Fixed a spurious "timer was never started" warning.

This commit is contained in:
Alexey Kopytov
2012-03-23 18:25:09 +04:00
parent fcff2d2386
commit f6daa31d15
3 changed files with 10 additions and 1 deletions

View File

@ -992,7 +992,7 @@ static void db_reset_stats(void)
So that intermediate stats are calculated from the current moment
rather than from the previous intermediate report
*/
if (sb_timer_initialized(&sb_globals.exec_timer))
if (sb_timer_running(&sb_globals.exec_timer))
sb_timer_split(&sb_globals.exec_timer);
if (sb_globals.debug)

View File

@ -69,6 +69,12 @@ int sb_timer_initialized(sb_timer_t *t)
return t->state != TIMER_UNINITIALIZED;
}
/* check whether the timer is running */
int sb_timer_running(sb_timer_t *t)
{
return t->state != TIMER_RUNNING;
}
/* start timer */

View File

@ -93,6 +93,9 @@ void sb_timer_reset(sb_timer_t *t);
/* check whether the timer is initialized */
int sb_timer_initialized(sb_timer_t *t);
/* check whether the timer is running */
int sb_timer_running(sb_timer_t *t);
/* start timer */
void sb_timer_start(sb_timer_t *);