---
title: "Discussion on \"Go Cheatsheet - Select with Timer & Ticker\" | Hashnode"
description: "Discussion on \"Go Cheatsheet - Select with Timer & Ticker\". Select\nSelect channels with timeout\nUse time.After\nselect {\ncase res := <-ch:\n    fmt.Println(res)\ncase <-time.After(1 * time.Second):\n    fmt.Println(\"timeout 1\")\n}\n\nOr use time.NewTimer\ntimer1 := time.NewTimer(2 * time.Second)\nselect {\ncase <-quit:..."
url: "https://hashnode.com/posts/go-cheatsheet-select-with-timer-and-ticker/6081919cfea38e52a9c58854"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Go Cheatsheet - Select with Timer & Ticker](https://hn.0xbf.me/go-cheatsheet-select-with-timer-and-ticker?utm_source=hashnode&utm_medium=feed)

Select Select channels with timeout Use time.After select { case res := <-ch: fmt.Println(res) case <-time.After(1 \* time.Second): fmt.Println("timeout 1") } Or use time.NewTimer timer1 := time.NewTimer(2 \* time.Second) select { case <-quit:...

Apr 22, 2021 · 1 min read · hn.0xbf.me  
Read the article

-   [#go](https://hashnode.com/tag/go)

## Written by

[0xBF](https://hashnode.com/@0xbf)

@0xbf

  
[View profile](https://hashnode.com/@0xbf)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
