def run_experiment(self): """ Run experiment, i.e. setup and execute it and store the results. """ experiment_start = time.time() # start clock for experiment duration self.setup_experiment() self.execute_experiment() experiment_stop = time.time() # stop clock for experiment duration duration = format_time(experiment_stop - experiment_start) self.specs.duration = duration log_from_medium(self.specs.verbosity, f"Experiment duration: {duration}") self.save_results()
def test_time_bigger_than_minute_should_be_minutes_and_seconds2(self): """ If the given time is bigger than a minute, it should be returned as minutes and seconds without digits. """ self.assertEqual("2:18min", plotter_evaluation.format_time(138.44444))
def test_time_smaller_than_minute_should_be_seconds2(self): """ If the given time is smaller than one minute, it should be returned as seconds with four digits. """ self.assertEqual("59.1234sec", plotter_evaluation.format_time(59.12345))