def getTimeSinceLastUpdate(IOType):
 global last_update_times
 current_time = time()
 last_time = last_update_times.get(IOType)
 if (not last_time):
  time_since_update = 1
 else:
  time_since_update = (current_time - last_time)
 last_update_times[IOType] = current_time
 return time_since_update

def getTimeSinceLastUpdate ( IOType ) : global last_update_times current_time = time ( ) last_time = last_update_times . get ( IOType ) if ( not last_time ) : time_since_update = 1 else : time_since_update = ( current_time - last_time ) last_update_times [ IOType ] = current_time return time_since_update
return the elapsed time since last update .