def calctime(t):
    """
    Calculate a string 'H:M:S.ms' out of a given no. of seconds.
    """
    msec = int('{0:.2f}'.format(t % 1)[2:])
    minute = int(t // 60)
    sec = int(t % 60)
    hour = int(minute // 60)
    minute = int(minute % 60)
    return '{0:02}:{1:02}:{2:02}.{3}'.format(hour, minute, sec, msec)
