Searched the interwebs for a while and got something that pointed me in the right direction so I could get the answer. Thought I'd share it for somebody in the future:
How to write an if statement in C# for a Stopwatch to check if time as elapsed
public Stopwatch timer = new Stopwatch();
if(timer.Elapsed.TotalSeconds == 0) {
// if timer hasn't started
}
or
if(timer.Elapsed.TotalSeconds > 0) {
// if timer has started
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.