adjust_stimtimes: single-threaded working version