# $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/obs_ctrl/timer.py 473 2018-03-13 17:03:13Z depa $

import time

class timer:
    def __init__(self):
        self.tBegin = time.time()
        self.tEnd = time.time()
        self.tElapsed = self.tEnd - self.tBegin
    def begin(self):
        self.tBegin = time.time()
    def end(self):
        self.tEnd = time.time()
    def elapsed(self):
        self.end()
        self.tElapsed = self.tEnd - self.tBegin
        return self.tElapsed

