three ways to set Timer time.sleep time.after time.Timer Reset and stop the Timer timer.Reset(d Duration) timer.Stop() use ticker to realize the periodic effects ticker := time.NewTicker(time.Second)