Remember... your CPU can halt at any time for any number of milliseconds. That means simple things like:
upperBound, lowerBound = readTime()
if (upperBound<deadline)
do_stuff(x, y, z)
Are incorrect... There is no guarantee that the 'if' statement didn't take many milliseconds, and that the stuff didn't end up happening after the deadline.It's also very easy to write code that works, but is theoretically wrong. You will leave a hidden bug that may only rear its head years down the line.