Guest User

Untitled

a guest
Oct 21st, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. for range time.Tick(30 * time.Millisecond) {
  2. doSomthing()
  3. }
  4.  
  5. //time.Tick()返回的是一个channel,每隔指定的时间会有数据从channel中出来,
  6. //for range不仅能遍历map,slice,array还能取出channel中数据,range前面可以不用变量接收,
  7. //所以可以简写成上面的形式。
Add Comment
Please, Sign In to add comment