code: def _get_total_time(timer: TimerProtocol) -> float:
      total_time = 0.0
      for _, durations in timer.recorded_durations.items():
          array_value = np.array(durations)
          array_sum = np.sum(array_value)
          total_time += array_sum
  
      return total_time
  
imports: import datetime
  import logging
  import os
  from collections import defaultdict
  from contextlib import contextmanager
  from time import perf_counter
  from typing import Any, Dict, Generator, List, Optional, Protocol, runtime_checkable, Sequence, Tuple, TypeVar
  import numpy
  import torch
  import torch.distributed
  from tabulate import tabulate
  from torchtnt.utils.distributed import PGWrapper
label_desc: Use image node_id 2 for calling a global function with example usage: _get_total_time(timer) and returns: total_time