code: public function endTimer(RunnerServiceContext $context, $duration = null, $timestamp = null)
      {
          if ($context instanceof QtiRunnerServiceContext) {
              /* @var TestSession $session */
              $session = $context->getTestSession();
              $session->endItemTimer($duration, $timestamp);
          } else {
              throw new \common_exception_InvalidArgumentType(
                  'QtiRunnerService',
                  'endTimer',
                  0,
                  'oat\taoQtiTest\models\runner\QtiRunnerServiceContext',
                  $context
              );
          }
          return true;
      }
docs: Ends the timer for the current item in the TestSession
  
  @param RunnerServiceContext $context
  @param float $duration The client side duration to adjust the timer
  @param float $timestamp allow to end the timer at a specific time, or use current when it's null
  @return bool
  @throws \common_exception_InvalidArgumentType