from time import time
class Timer :
	def __init__( self, format = "%.2f" ) :
		self.t0 = time()
		self.t1 = self.t0
		self.format = format

	def __str__( self ) :
		self.lastTime = self.t1
		self.t1 = time()
		sinceInst = self.format % ( self.t1 - self.t0 )
		sinceLast = self.format % ( self.t1 - self.lastTime )
		return "%s s inst., %s s last" % (sinceInst, sinceLast)
		
