7
Timers and Tickers
Many long-lived applications impose limits on how long an operation can last. They also perform tasks such as health checks periodically to ensure all components are working as expected. Many platforms provide high-precision timer operations, and the Go standard library provides portable abstractions of these services in the time package. We will look at timers and tickers in this chapter. Timers are tools for doing things later, and tickers are tools for doing things periodically.
The key sections we will review in this chapter are the following:
- Timer – running something later
- Tickers – running something periodically
At the end of this chapter, you will have seen how to work with timers and tickers and how you can monitor ...
Get Effective Concurrency in Go now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.