# $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/test/end_2_end/timer.py 296 2017-11-16 17:00:51Z 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

