Last active
September 16, 2022 09:26
-
-
Save hfhimage/b39fcf9cf0c3519bb4aa38970827b535 to your computer and use it in GitHub Desktop.
go 定时器
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ticker := time.NewTicker(frequency) | |
defer ticker.Stop() | |
for range ticker.C { | |
// do your stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment