class_docstr: 这个 callback 的作用是打印训练过程中的相关时间信息，例如训练时长、评测时长、总时长等
class_docstr_tok: ["\u8fd9\u4e2a","callback","\u7684\u4f5c\u7528\u662f\u6253\u5370\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684\u76f8\u5173\u65f6\u95f4\u4fe1\u606f\uff0c\u4f8b\u5982\u8bad\u7ec3\u65f6\u957f\u3001\u8bc4\u6d4b\u65f6\u957f\u3001\u603b\u65f6\u957f\u7b49"]
code: def format_timer(self, reset=True):
      line = ""
      timers = [
          "fetch-data",
          "forward",
          "backward",
          "optimize",
          "evaluate",
          "train",
          "total",
      ]
      for timer_name in timers:
          if not timer_name in self.timers:
              continue
          timer = self.timers(timer_name)
          elapsed = round(timer.elapsed(reset=reset), self.time_ndigit)
          if elapsed != 0:
              line = line + f", {timer_name}: {elapsed}s"
      return line
  
imports: import time
  from .callback import Callback
  from ..log import logger
label_desc: Use image node_id 12 for calling the TimerCallback obj's underlying member method code with example usage: obj.format_timer(reset) and returns: line