So I have a program that I would like to run every hour. All the code I need is in Email.Run() which I execute in the main. Looking online I found a solution that I pieced together for a timer. My problem is that my program will accumulate an enormous amount of memory and CPU after about 30-45 minutes of running. I've been looking into garbage collection and haven't found much help there, besides that the system should do it all on its own. I've heard that the library Timer is a bit outdated? I'm starting here because I don't think there's a problem with how my Run() method performs. I think the main method is performing too many behind the scene "checks" of the time maybe. I don't see anything wrong with my code but can anyone provide any insight or other coding techniques to perform this every hour method?I also looked into threading but I want to know if that would be the solution or not. I would still need to include a timer in the
thread and I think that maybe that's where my logic is going wrong.
Thank you