commit | 80b9fac54d29c0b915a080a2317704753a5800ce | [log] [tgz] |
---|---|---|
author | Gaal Yahas <gaal@google.com> | Sun Aug 07 12:25:30 2022 +0000 |
committer | Sameer Ajmani <sameer@golang.org> | Thu Oct 20 02:37:24 2022 +0000 |
tree | e0da087f5d32beb707b05eb72c591963aa1380cb | |
parent | f3bd1da661afd6357b957af27c50ccdb248b7dd3 [diff] |
x/time/rate: add rate.Sometimes, which runs a function occasionally. Modeled after sync.Once; intended to provide simple throttling akin to the C++ log functions LOG_FIRST_N, LOG_EVERY_N, and LOG_EVERY_N_SEC. Originally authored by sameer@golang.org. Fixes golang/go#54237 Change-Id: I7c6266cc780eb6dad30d310485de492f790dbcdb Reviewed-on: https://go-review.googlesource.com/c/time/+/421915 Reviewed-by: Sameer Ajmani <sameer@golang.org>
This repository provides supplementary Go time packages.
The easiest way to install is to run go get -u golang.org/x/time
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/time
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the time repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/time:” in the subject line, so it is easy to find.