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"]
docstr: :param print_every: 在哪个时候打印时间信息。
  
      * *负数*: 表示每隔多少 epoch 结束打印一次；
      * *0*: 表示整个训练结束才打印；
      * *正数*: 每隔多少个 step 打印一次；
  
  :param time_ndigit: 保留多少位的小数
docstr_tok: [":","param","print_every",":","\u5728\u54ea\u4e2a\u65f6\u5019\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u3002","*","*","\u8d1f\u6570","*",":","\u8868\u793a\u6bcf\u9694\u591a\u5c11","epoch","\u7ed3\u675f\u6253\u5370\u4e00\u6b21\uff1b","*","*","0","*",":","\u8868\u793a\u6574\u4e2a\u8bad\u7ec3\u7ed3\u675f\u624d\u6253\u5370\uff1b","*","*","\u6b63\u6570","*",":","\u6bcf\u9694\u591a\u5c11\u4e2a","step","\u6253\u5370\u4e00\u6b21\uff1b",":","param","time_ndigit",":","\u4fdd\u7559\u591a\u5c11\u4f4d\u7684\u5c0f\u6570"]
code: def __init__(self, print_every=-1, time_ndigit=3):
      """
  
      :param print_every: 在哪个时候打印时间信息。
  
          * *负数*: 表示每隔多少 epoch 结束打印一次；
          * *0*: 表示整个训练结束才打印；
          * *正数*: 每隔多少个 step 打印一次；
  
      :param time_ndigit: 保留多少位的小数
      """
      assert isinstance(
          print_every, int
      ), "print_every must be an int number."
      self.timers = Timers()
      self.print_every = print_every
      self.time_ndigit = time_ndigit
  
imports: import time
  from .callback import Callback
  from ..log import logger
label_desc: Use image node_id 1 to create a new TimerCallback object from inherited base classes: Callback with example: obj = TimerCallback(print_every, time_ndigit)