DateTime CurrentTime = DateTime.Now; DateTime EndTime = CurrentTime.AddMinutes(1); while (TRUE) { CurrentTime = DateTime.Now; if (CurrentTime>EndTime) { EndTime=CurrentTime.AddMinutes(1); DOSOMETHING; } }
Quote:I think constantly checking DateTime.Now against an end time that updates after the end time is reached seems computationally intensive, and I was wondering if there is more computationally efficient way to check a condition periodically.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)