public function endIf(bool $condition, ?callable $callback = null): void
    {
        if ((bool) $condition) {
            $this->end($callback);
        }
    }
public function endIf(bool $condition, ?callable $callback = null): void
    {
        if ((bool) $condition) {
            $this->end($callback);
        }
    }
public function endIf ( bool $ condition , ? callable $ callback = null ) : void { if ( ( bool ) $ condition ) { $ this -> end ( $ callback ) ; } }
End the timer if condition is matched.

@param  bool  $condition
@param  callable|null  $callback

@return void
End the timer if condition is matched .