I have a method that needs to rerun until it either returns True or a set time period has passed. Would a cancellation token be the way to do this? A stopwatch? A timer?
Do While partReady = False
partReady = readTag(part, "_IO_EM_DI_04")
Loop
Runs it until I get true returned but I need this to cancel and throw and exception or exit the loop after a given time period.