I have a GUI in which I would like to periodically check a) if a text file has been modified and
if the names of a file inside a directory have changed.
I don't want to put it right inside my While(1) loop because either it will be checking too often (I don't want to be accessing these files any more often than necessary - they're on a network used by other people) or slowing down my GUI response if I add a delay.
Is there any way that I can regularly call my "check files" function without disturbing my main GUI and without checking many times per second?

I don't want to put it right inside my While(1) loop because either it will be checking too often (I don't want to be accessing these files any more often than necessary - they're on a network used by other people) or slowing down my GUI response if I add a delay.
Is there any way that I can regularly call my "check files" function without disturbing my main GUI and without checking many times per second?