How to save Time of the object when it detected in Video using YoloV5 or YoloV8

Adding this here so everything remains on the same thread (this one), since it’s the same inquiry, rather than a new one: