Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"The smallest unit of time is a milli/second" seems a bit silly, as it really depends on your application. Is he expecting programmers to implement time in Planck units?


The specific issue that bit me wrt units of time was seconds vs. milliseconds. This came up the first time I needed to mix PHP time stamps with Jenkins build log time stamps. One is in seconds, the other in milliseconds. Unfortunately the PHP date() function exhibits odd behavior when a time stamp contains two extra digits. I could have saved myself the debugging time had I not been so attached to the assumption that time stamps are always in seconds rather than sometimes in milliseconds.


It's not uncommon for languages and libraries to assume that millis are the smallest resolution. Java is getting better, but is still pretty hit or miss. But if you're writing performance sensitive code you're definitely in micros and maybe in high nanos. There's a lot of those in a millisecond.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: