parameters: (self, cp_op_name, add_op)
return_statement: return task
docstring: Build a Task that will measure the time span of checkpoint operations,
          once operation is done, time can be read from _current_checkpoint_duration.
  
          Args:
              cp_op_name: A string name of the checkpoint operation.
              add_op: A functor to add the checkpoint operation.
  
          Returns:
              A task with timer.
docstring_summary: Build a Task that will measure the time span of checkpoint operations,
          once operation is done, time can be read from _current_checkpoint_duration.
docstring_tokens: Build a Task that will measure the time span of checkpoint operations once operation is done time can be read from _current_checkpoint_duration .
function: def _timed_task(self, cp_op_name, add_op):
          """
          Build a Task that will measure the time span of checkpoint operations,
          once operation is done, time can be read from _current_checkpoint_duration.
  
          Args:
              cp_op_name: A string name of the checkpoint operation.
              add_op: A functor to add the checkpoint operation.
  
          Returns:
              A task with timer.
          """
          with Task(name=cp_op_name) as task:
              with ops.task_init():
                  timer = ops.TimerBegin([], counter_name=self._node_name)
              add_op()
              with ops.task_exit():
                  time_span_blob = ops.TimerGetAndEnd(timer)
              self._current_checkpoint_duration = final_output(time_span_blob)
          return task
function_tokens: def _timed_task ( self , cp_op_name , add_op ) : with Task ( name = cp_op_name ) as task : with ops . task_init ( ) : timer = ops . TimerBegin ( [ ] , counter_name = self . _node_name ) add_op ( ) with ops . task_exit ( ) : time_span_blob = ops . TimerGetAndEnd ( timer ) self . _current_checkpoint_duration = final_output ( time_span_blob ) return task