class_docstr: Track step performance statistics.
docstr: Returns average step time (seconds) so far.
  
  Args:
    warmup: If true ignore first set of steps executed as determined by
      `log_steps`.
  
  Returns:
    Average step time in seconds.
docstr_tok: ["Returns","average","step","time","(","seconds",")","so","far",".","Args",":","warmup",":","If","true","ignore","first","set","of","steps","executed","as","determined","by","`","log_steps","`",".","Returns",":","Average","step","time","in","seconds","."]
code: def get_average_step_time(self, warmup=True):
      """Returns average step time (seconds) so far.
  
      Args:
        warmup: If true ignore first set of steps executed as determined by
          `log_steps`.
  
      Returns:
        Average step time in seconds.
      """
      if warmup:
          if len(self.timestamp_log) < 3:
              return -1
          elapsed = (
              self.timestamp_log[-1].timestamp
              - self.timestamp_log[1].timestamp
          )
          return elapsed / (
              self.log_steps * (len(self.timestamp_log) - 2)
          )
      else:
          if len(self.timestamp_log) < 2:
              return -1
          elapsed = (
              self.timestamp_log[-1].timestamp
              - self.timestamp_log[0].timestamp
          )
          return elapsed / (
              self.log_steps * (len(self.timestamp_log) - 1)
          )
  
imports: import datetime
  import os
  import time
  from typing import Dict, Optional, Tuple
  from absl import logging
  import numpy
  from six.moves import range
  from six.moves import zip
  import tensorflow
  from tensorflow.core.util import event_pb2
  from tensorflow.python.lib.io import tf_record
label_desc: Use image node_id 5 for calling the TimeHistory obj's underlying member method code with example usage: obj.get_average_step_time(warmup) and returns: unknown, unknown, unknown, unknown