Record the start time of the scenario into the `$scenario_run_times` array.
183935
private static function log_run_times_before_scenario( $event ) {
		$scenario_key = self::get_scenario_key( $event );
		if ( $scenario_key ) {
			self::$scenario_run_times[ $scenario_key ] = -microtime( true );
		}
	}
842006
async def runOnceNicely(self):
        
        start = time.perf_counter()
        msgsProcessed = await self.prodAllOnce()
        if msgsProcessed == 0:
            # if no let other stuff run
            await asyncio.sleep(0.01, loop=self.loop)
        dur = time.perf_counter() - start
        if dur >= 15:
            logger.info("it took {:.3f} seconds to run once nicely".
                        format(dur), extra={"cli": False})
215395
def set_start_time(self, start_time):
        
        start_time = start_time or dt.time()
        if isinstance(start_time, dt.time): # ensure that we operate with time
            self.start_time = dt.time(start_time.hour, start_time.minute)
        else:
            self.start_time = dt.time(start_time.time().hour, start_time.time().minute)
868376
private static function log_run_times_after_scenario( $event ) {
		$scenario_key = self::get_scenario_key( $event );
		if ( $scenario_key ) {
			self::$scenario_run_times[ $scenario_key ] += microtime( true );
			self::$scenario_count++;
			if ( count( self::$scenario_run_times ) > self::$num_top_scenarios ) {
				arsort( self::$scenario_run_times );
				array_pop( self::$scenario_run_times );
			}
		}
	}
1088424
public function startCounter() : float
    {
        $this->startTime = microtime(true);
        $this->startMem = memory_get_usage();

        return $this->startTime;
    }
667024
public function startTime()
	{
		$time = microtime();
		$time = explode(' ', $time);
		$time = $time[1] + $time[0];
		$this->startTime = $time;
	}
764080
def populate_times(self):
        
        stop_time = self.meta_data.get("stop_time")
        if stop_time:
            stop_naive = datetime.utcfromtimestamp(stop_time)
            self.stop_time = stop_naive.replace(tzinfo=tzutc())

        creation_time = self.meta_data.get("creation_time")
        if creation_time:
            creation_naive = datetime.utcfromtimestamp(creation_time)
            self.creation_time = creation_naive.replace(tzinfo=tzutc())

        start_time = self.meta_data.get("start_time")
        if start_time:
            start_naive = datetime.utcfromtimestamp(start_time)
            self.start_time = start_naive.replace(tzinfo=tzutc())
195678
def start_recording(self):
        """"""
        self._recording = True
        self._stop_recording.clear()
        self._source.start()
20797
def my_init(self):
        
        self._start_time = time.time()
        self._stats = {}
        self._stats_lock = threading.Lock()
400360
def start_output (self):
        
        # map with spaces between part name and value
        if self.logparts is None:
            parts = Fields.keys()
        else:
            parts = self.logparts
        values = (self.part(x) for x in parts)
        # maximum indent for localized log part names
        self.max_indent = max(len(x) for x in values)+1
        for key in parts:
            numspaces = (self.max_indent - len(self.part(key)))
            self.logspaces[key] = u" " * numspaces
        self.stats.reset()
        self.starttime = time.time()
652454
def persist_time(run, session, timings):
    
    from benchbuild.utils import schema as s

    for timing in timings:
        session.add(
            s.Metric(name="time.user_s", value=timing[0], run_id=run.id))
        session.add(
            s.Metric(name="time.system_s", value=timing[1], run_id=run.id))
        session.add(
            s.Metric(name="time.real_s", value=timing[2], run_id=run.id))
1081036
private static function log_run_times_before_suite( $event ) {
		self::$suite_start_time = microtime( true );

		Process::$log_run_times = true;

		$travis = getenv( 'TRAVIS' );

		// Default output settings.
		self::$output_to = 'stdout';
		self::$num_top_processes = $travis ? 10 : 40;
		self::$num_top_scenarios = $travis ? 10 : 20;

		// Allow setting of above with "WP_CLI_TEST_LOG_RUN_TIMES=<output_to>[,<num_top_processes>][,<num_top_scenarios>]" formatted env var.
		if ( preg_match( '/^(stdout|error_log)?(,[0-9]+)?(,[0-9]+)?$/i', self::$log_run_times, $matches ) ) {
			if ( isset( $matches[1] ) ) {
				self::$output_to = strtolower( $matches[1] );
			}
			if ( isset( $matches[2] ) ) {
				self::$num_top_processes = max( (int) substr( $matches[2], 1 ), 1 );
			}
			if ( isset( $matches[3] ) ) {
				self::$num_top_scenarios = max( (int) substr( $matches[3], 1 ), 1 );
			}
		}
	}
320238
private static void printStartStopTimes() {
        final long start = System.currentTimeMillis();

        System.err.println("Start at " + new Date());

        Thread hook = new Thread() {
            @Override
            public void run() {
                long timePassed = System.currentTimeMillis() - start;
                System.err.println("Stop at " + new Date() + ", execution time = " + timePassed + " ms");
            }
        };
        Runtime.getRuntime().addShutdownHook(hook);
    }
781541
def run(args)
      start_time    = Time.now.to_f
      files         = extract_files(args)
      configuration = load_configuration

      configure(configuration, options)

      runner    = Runner.new(configuration)
      output    = runner.analyze(files)
      exec_time = Time.now.to_f - start_time
      status    = 0

      unless output.empty?
        status = 1
        puts output
      end

      show_benchmark_info(exec_time) if options[:benchmark]

      exit(status)
    end
964706
def setStartdatetime(self, recording_start_time):
        
        if isinstance(recording_start_time,datetime):
            self.recording_start_time = recording_start_time
        else:
            self.recording_start_time = datetime.strptime(recording_start_time,"%d %b %Y %H:%M:%S")
        self.update_header()
493277
def run
      start_time = Time.new.to_f
      Signal.trap('TERM') do
        log.info('SIGTERM received. shutting down gracefully...')
        @request_shutdown = true
      end
      run_desc = @dry_run ? 'dry run' : 'run'
      log.info("beginning alerts #{run_desc}")

      alerts = read_alerts(@alert_sources)
      groups = read_groups(@group_sources)
      hosts = read_hosts(@host_sources)

      @destinations.each do |dest|
        dest['options'] ||= {}
        dest['options']['dry_run'] = true if @dry_run
      end

      update_alerts(@destinations, hosts, alerts, groups)

      run_time = Time.new.to_f - start_time
      if @request_shutdown
        log.info("interferon #{run_desc} shut down by SIGTERM")
      else
        statsd.gauge('run_time', run_time)
        log.info("interferon #{run_desc} complete in %.2f seconds" % run_time)
      end
    end
222547
def start(self):
        """"""
        if self._properties.get("startMs") is None:
            return None
        return _helpers._datetime_from_microseconds(
            int(self._properties.get("startMs")) * 1000.0
        )