3 ms·
time.Second * time.Second The type of this is `time.Duration` (or int64 internally), not `time.Second` (which is a const with a value). I agree, though, that
by frozenice 5y ago
time.Second * time.Second
The type of this is `time.Duration` (or int64 internally), not `time.Second` (which is a const with a value).
I agree, though, that this is not quite sound, because it can be misused, as shown above with `time.Sleep(delaySecs * time.Second)`.
In Kotlin you can do `1.seconds + 1.minutes` but not `1.seconds * 1.minutes` (compilation error), which I quite like. Here is a playground link: https://pl.kotl.in/YZLu97AY8 https://pl.kotl.in/YZLu97AY8