def normalized_total_time(p, max_time=3600000): # by default 1 h (in ms)
    """If time was longer than max_time, then return max_time, otherwise return time."""
    if p["result.totalTimeSystem"] == "3600.0":
        v = 3600000  # convert to ms (error in logging)
    else:
        v = int(float(p["result.totalTimeSystem"]))
    return max_time if v > max_time else v