cleanup
create tmsw_delay()