def timestamp_name(name: str, length: int) -> str:
    suffix = "-{{(macros.time.time() * 1000) | int}}"
    suffix_len = len("-1622600846000")  # Length will not change for > 100 years.
    if len(name) + suffix_len <= length:
        return name + suffix
    name_len = length - suffix_len
    name_fragment = name[:name_len]
    return name_fragment + suffix
