3 ms·
I find it easier to do something like: SECONDS_IN_MINUTE = 60 REFRESH_TIME_MINUTES = 15 REFRESH_TIME_SECONDS = SECONDS_IN_MINUTE * REFRESH_TIME_MINUTES e.g.
by shepherdjerred 2y ago
I find it easier to do something like:
SECONDS_IN_MINUTE = 60
REFRESH_TIME_MINUTES = 15
REFRESH_TIME_SECONDS = SECONDS_IN_MINUTE * REFRESH_TIME_MINUTES
e.g. I define every constant separately, and ideally any constant defined by an operation will only have one such operation. This makes mistakes _much_ easier to spot.
- psd1 2y agonew TimeSpan(minutes = 15)
- shepherdjerred 2y agoDepending on the language, this is definitely preferable!
- psd1 2y agoOh the places you'll go When you roll your own date You'll think you are great 'Til you're 6 minutes slow!