def convert_time(tm):
	"""
	Converts a given time to seconds
	Time can be presented as just seconds (does nothing)
	or of the format HH:MM:SS.MICROSECONDS
	"""
	seconds=0 #our accumulator
	scale=1 #used when converting minutes, hours
	micro="0" #add back any microseconds given
	tm=str(tm)
	if '.' in tm:
		tm,micro = tm.split('.')
	units = tm.split(':')
	#now, work in increasing order as (minutes,hours) are optional
	units.reverse()
	for i in units:
		seconds += (int(i)*scale)
		scale *= 60 #next time unit up will need this as the scaler
	return float("%d.%s" % (seconds,micro))