System Threading Timer not continuously working

i73

Member
Joined
Sep 27, 2016
Messages
5
Programming Experience
3-5
Hello, I am running into a problem with my Task, whenever my computer either sleeps or enters hibernation the threading task ends and will not continue until I run my program again, is there a way I can get this to work even when the system halts?
C#:
            var timer = new System.Threading.Timer(
                e => MyMethod(),
                null,
                TimeSpan.Zero,
                TimeSpan.FromMinutes(30));

Thanks!
 

Latest posts

Back
Top Bottom