How long can widget be executed after being activated by the iOS system

Widgets are activated by the iOS system at regular intervals, and the task code defined in the TimelineProvider is executed.

How long can this task code be executed at most?

I don't think the system will allow tasks defined in the timeline to be executed continuously (looking like a background resident program), so there must be a time limit.

If you know, or if there are related document links, please let me know Thank you.