input: Write a python function to measure the elapsed time using the Timer class.
  assert Timer().elapsed() == 0
  timer = Timer()
  timer.start()
  time.sleep(1)
  timer.end()
  assert round(timer.elapsed()) == 1
  timer.start()
  time.sleep(2)
  timer.end()
  assert round(timer.elapsed()) == 2
output: import time
  
  class Timer:
      def __init__(self):
          self._start_time = None
          self._end_time = None
  
      def start(self):
          self._start_time = time.time()
          self._end_time = None
  
      def end(self):
          self._end_time = time.time()
  
      def elapsed(self):
          if self._start_time is None:
              return 0
          if self._end_time is None:
              return time.time() - self._start_time
          return self._end_time - self._start_time