code: def test_time_log():
      logger = get_logger(__name__)
      logger.handlers = []
  
      @time_log(logger)
      def _my_timed_fn():
          # do something for some time
          for _ in range(2):
              pass
  
      with LogCapture() as lc:
          _my_timed_fn()
  
      logged_message = lc.records[-1].getMessage()
      assert (
          re.fullmatch(
              "_my_timed_fn function ran for [0-9]+ milliseconds",
              logged_message,
          )
          is not None
      )
  
file_path: darts/darts/tests/test_logging.py
imports: import logging
  import re
  import numpy
  import pandas
  import pytest
  import xarray
  from testfixtures import LogCapture
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if_not, raise_log, time_log
label_desc: Use image node_id 6 for calling a global function with example usage: test_time_log() without return types