I wrote a program long ago, in C that detects and exits infinite loops in my programming, if they happen.
For instance, in order to detect a infinite loop, I use a time counter to count the duration in seconds, of where a loop can happen. I start the counter before the loop starts, and update...