Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import datetime


class Stopwatch:
  def __init__(self):
    self.begin = None

  def start_measurement(self, category):
    self.begin = datetime.datetime.now()

  def foo(self):
    print(self.begin)


sp = Stopwatch()
sp.start_measurement("test")
sp.foo()