Stop standby or suspend when program is running

When the program is running it is very helpful that the PC doesn't go into standby or suspend mode till the program stop its activity

Thank you.