You can sure change it. What Mark suggested would work.
However, I disagree with your point. I've used more timers less than 1 second or timeouts like 1.5 seconds that I kinda find the milliseconds method better. Plus its so standard thanks to langs like Java and C and our own JS that any API respecting seconds would feel plain weird
I've used more timers less than 1 second or timeouts like 1.5 seconds
What's the problem with sleep(1.5)? I still find that more natural than sleep(1500)
Plus its so standard
No it's not. C uses seconds, the linux command-line program sleep also uses seconds... There's lots of examples out there and milliseconds is far from common.
The only two differences are:
Seconds are the SI base unit.
Seconds are within the orders of magnitude that humans can perceive.
I'd say both of those are clearly benefits of using seconds.
The context switching is precisely why I want this. If you're dealing with seconds in the backend but have to constantly switch to thinking in milliseconds for the frontend code, that's mental work I could spend thinking about the actual code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can sure change it. What Mark suggested would work.
However, I disagree with your point. I've used more timers less than 1 second or timeouts like 1.5 seconds that I kinda find the milliseconds method better. Plus its so standard thanks to langs like Java and C and our own JS that any API respecting seconds would feel plain weird
What's the problem with
sleep(1.5)
? I still find that more natural thansleep(1500)
No it's not. C uses seconds, the linux command-line program
sleep
also uses seconds... There's lots of examples out there and milliseconds is far from common.The only two differences are:
I'd say both of those are clearly benefits of using seconds.
Well, you have a point.
However having seconds measurement in a language that puts milliseconds as first class citizens would incur the cost of context switching.
Thanks for the info
The context switching is precisely why I want this. If you're dealing with seconds in the backend but have to constantly switch to thinking in milliseconds for the frontend code, that's mental work I could spend thinking about the actual code.