class_docstr: Unit test class for general utilities. 
class_docstr_tok: ["Unit","test","class","for","general","utilities","."]
docstr: Tests the running time of the package with and without file writing. 
docstr_tok: ["Tests","the","running","time","of","the","package","with","and","without","file","writing","."]
code: def test_direct_times(self):
      """Tests the running time of the package with and without file writing."""
      self.report("DiRect running times")
      log_file_names = ["", "test_log"]
      for prob in self.problems:
          clock_times = []
          real_times = []
          for log_file_name in log_file_names:
              start_clock = time.clock()
              start_real_time = time.time()
              _, _, _ = oper_utils.direct_ft_maximise(
                  prob.obj,
                  prob.bounds,
                  self.max_evals,
                  log_file_name=log_file_name,
              )
              clock_time = time.clock() - start_clock
              real_time = time.time() - start_real_time
              clock_times.append(clock_time)
              real_times.append(real_time)
              if log_file_name:
                  try:
                      os.remove(log_file_name)
                  except OSError:
                      pass
          # Print results out
          result_str = ", ".join(
              [
                  "file: '%s': clk=%0.4f, real=%0.4f, #evals=%d"
                  % (
                      log_file_names[i],
                      clock_times[i],
                      real_times[i],
                      self.max_evals,
                  )
                  for i in range(len(log_file_names))
              ]
          )
          self.report(
              "%s:: %s" % (prob.descr, result_str), "test_result"
          )
  
imports: from __future__ import absolute_import
  import os
  import time
  from argparse import Namespace
  import numpy
  from .ancillary_utils import is_nondecreasing
  from .base_test_class import BaseTestClass, execute_tests
  from .euclidean_synthetic_functions import get_mf_hartmann_function_data
  from .None import oper_utils
label_desc: Use image node_id 7 for calling the OptimisersTestCase obj's underlying member method code with example usage: obj.test_direct_times() without return types