Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 223 Bytes

timer.md

File metadata and controls

11 lines (9 loc) · 223 Bytes

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)