Reputation: 4184
I want to implement a function which waits n seconds before retrying in case of a failure, but what would be the proper way of implementing the waiting-routine.
I figured that an endless loop with an if-clause might cause unwanted CPU-usage.
(do ((time (+ (get-universal-time) (- n 1)))
(time-cur (get-universal-time) (get-universal-time)))
((< time time-cur) nil))
Therefore: Would this be considered proper code or is there a more standard way?
Upvotes: 4
Views: 1510