class_docstr: Class to collect timing tasks.
class_docstr_tok: ["Class","to","collect","timing","tasks","."]
docstr: Return sum of CPU time for all so far finished tasks.
docstr_tok: ["Return","sum","of","CPU","time","for","all","so","far","finished","tasks","."]
code: def total_cpu(self) -> float:
      """Return sum of CPU time for all so far finished tasks."""
      tasks = self.tasks.values()
      return sum(
          [t.cpu_duration for t in tasks if t.cpu_duration is not None]
      )
  
imports: from __future__ import annotations
  from typing import Iterator, Mapping, Optional, Tuple
  import sys
  import time
  from contextlib import contextmanager
  from itertools import repeat
  from typing_extensions import Literal
label_desc: Use image node_id 8 for calling the StopWatch obj's underlying member method code with example usage: obj.total_cpu() and returns: sum