add ‘reset’ and ‘sleep_time’ to Clock
Use ‘select’ to wait for IO