original_string: public function endTiming($key, $sampleRate = 1)
      {
          $end = gettimeofday(true);
          if (isset($this->timings[$key])) {
              $timing = ($end - $this->timings[$key]) * 1000;
              $this->timing($key, $timing, $sampleRate);
              unset($this->timings[$key]);
              return $timing;
          }
          return null;
      }
code: public function endTiming($key, $sampleRate = 1)
      {
          $end = gettimeofday(true);
          if (isset($this->timings[$key])) {
              $timing = ($end - $this->timings[$key]) * 1000;
              $this->timing($key, $timing, $sampleRate);
              unset($this->timings[$key]);
              return $timing;
          }
          return null;
      }
code_tokens: public function endTiming ( $ key , $ sampleRate = 1 ) { $ end = gettimeofday ( true ) ; if ( isset ( $ this -> timings [ $ key ] ) ) { $ timing = ( $ end - $ this -> timings [ $ key ] ) * 1000 ; $ this -> timing ( $ key , $ timing , $ sampleRate ) ; unset ( $ this -> timings [ $ key ] ) ; return $ timing ; } return null ; }
docstring: Ends the timing for a key and sends it to StatsD
  
  @param string $key
  @param int|float $sampleRate the rate (0-1) for sampling.
  @return float|null
docstring_tokens: Ends the timing for a key and sends it to StatsD