How to implement timestopping and earlystopping callback on pytorch

Hi, I want to ask some problem about Callback.
It i need to implement timestopping and earlystopping on native pytorch without pytorch-lightning or ignite.
How do i implement? and why native pytorch does not support Callback object like tensorflow?
I will be appreciate for any answer.