4 ms·
Many timeout functions take seconds as a floating point. So you could time out on 0.05 seconds (5 milis). But now the code is clear and less prone to bugs.
by dahfizz 5y ago
Many timeout functions take seconds as a floating point. So you could time out on 0.05 seconds (5 milis). But now the code is clear and less prone to bugs.
- sethammons 5y agoIn Go, you don't pass a float, you pass a duration
- catlifeonmars 5y agoWhich is unitless, hence there is no problem. `time.Duration.Seconds()` returns a floating point.