Assuming your program has a main loop (that runs over and over again) and some way of reading the current time, then it's super simple.
1) When starting assign the value of current time to some persistent variable (such as a global) as start time
2) Each time through the main loop of your program, read the current time, and subtract the start time
3) If the interval calculated is >= 60 seconds, and the process is running, stop the process and declare success
In Arduino-like code, it might look like:
unsigned long startTime;
bool running;
void setup() {
// whatever
}
void loop() {
if (running) {
unsigned long now = millis();
unsigned long elapsed = now - startTime;
if (elapsed >= 60000) { // 60 seconds
running = false;
complete();
}
}
else {
if (should_start()) {
running = true;
startTime = millis();
}
}
}
You implement should_start() and complete().
}