| sleep calcTimerDelta | sleep := [:ms| | future | future := Future new. future handle. [ future return ] valueDeferred: ms. future ]. calcTimerDelta := [:ms| | start | start := DateTime new. (sleep value: ms) wait. DateTime new - start ] future. (calcTimerDelta value: 2000) resolve: [:err :val| self print: 'Set timer for 2000ms, waited ' ,val ,'ms' ]