5 ms·
It's brilliant. And the front-end code, though not at all complicated, is clean and easy to understand. I can't speak for code quality, though. NIST published
by eganist 7y ago
It's brilliant. And the front-end code, though not at all complicated, is clean and easy to understand. I can't speak for code quality, though.
NIST published an update to their About page for time.gov mid-week (https://www.nist.gov/pml/time-and-frequency-division/about-timegov https://www.nist.gov/pml/time-and-frequency-division/about-t... ); the only reason I know it was updated today or might've been late last night is because I used the old time.gov to set a watch the day before, and when I opened the tab today, the clock read:
aN:aN:aN
---
The nice part is that save for the custom web analytics code from digitalgov.gov as well as jquery, it's not minimized.
- zingermc 7y agoAre those the last two characters of stringing NaN?
- eganist 7y agoyes!
- chipperyman573 7y agoI wonder what the deal with them refreshing every 10 minutes is... This is at the bottom: setInterval(function() { location.reload(); }, 600000);
- eganist 7y agoMy only guess is accounting for local clock drift.
- kijin 7y agoThey're probably still tinkering with this and that, and the forced reload ensures that what's on the screen isn't too different from what they're actually serving even if users keep their tabs open all day long. If they change something, like moving a timezone boundary, they only need to wait 10 minutes before all clients are updated. Moreover, any clock that updates itself in JS is also limited by the accuracy of the device's own clock. Periodic reloading ensures that the displayed time doesn't drift far from the server's clock. Of course they could do this by AJAX, but location.reload() also works fine if there's no client state worth preserving.
- corylulu 7y agoYeah, should definitely be done with a XHR/Fetch call. Honestly, I would love if it updated through a websocket considering it's lower latency and can update far more often without the need for expensive HTTPS calls or a reliance on internal clocks.
- kortilla 7y agoSounds like pointless astronaut engineering. What problem do you think that would solve?
- ascar 7y agoI don't think their 10 minute update interval is based on the performance limitations of the HTTP protocol, but used because it's simply not necessary to do it more often. Maintaining an open full duplex connection for a single fetch request every ten minutes sounds like terrible overengineering that in the end is probably much worse performance wise. Both protocols use TCP as an underlying protocol. So the latency of the timedata from the final request should be pretty much the same (neglectible differences due to larger HTTP header that needs to be sent and parsed on receive). We don't really care about the additional round-trips before, because they don't affect the clockdrift. However, if you really do care about the clockdrift due to client-server latency there are protocols like NTP that try to calculate that drift and minimize it.
- datafatmunger 7y agoThey didn't upgrade their JS apparently. Could have been es6 arrow notation. :)
- collinmanderson 7y agoA lot of people still use IE11 which doesn't support arrow notation :/ Sadly, IE 11 isn't going away any time soon.
- PoorlyDirected 7y agoSomewhere in the FAQ they indicate that NIST and the US Navy sync their clocks every 10 minutes. I'd wager that is why they refresh the webpage at that same frequency.
- sneak 7y agoWhy does time.gov need analytics? None of the usual reasons businesses cite as requiring them are valid here.
- eganist 7y agoThe accountability of government to the people would be the primary reason, the idea being to show the value for the money you're being taxed. But to answer your specific question, regardless of whether it's needed or not, it's mandatory. https://www.whitehouse.gov/sites/whitehouse.gov/files/omb/memoranda/2017/m-17-06.pdf https://www.whitehouse.gov/sites/whitehouse.gov/files/omb/me... requirement #2
- mattmar96 7y agoInteresting stuff. Surprised to see such tech literacy on the White House’s website.
- willis936 7y agoThe fed is also responsible for making ghidra. Not everyone working for the fed is a lawyer.
- toomuchtodo 7y agoYou shouldn't be. There are incredibly competent technologists currently in positions to deliver. https://www.usds.gov/ https://www.usds.gov/ https://18f.gsa.gov/ https://18f.gsa.gov/
- acdha 7y agoThink a little deeper about that: the government doesn’t need to sell things but that doesn’t mean that the people building sites don’t care about knowing who’s visiting, what they do, or how the site performed. For example, when do you stop spending more money supporting old browsers? There’s even an open source project around the public analytics.usa.gov dashboard: https://github.com/18F/analytics.usa.gov https://github.com/18F/analytics.usa.gov
- xwowsersx 7y agoAgreed, really brilliant. The way the different states are colored according to their time zone and then that color reaching out to the labels on top with those ray-like things is actually pretty clever. Interesting to wonder how often are people needing to come up for a design for this type of information? Am I wrong to think not very often? My point is it's cool to see a design for something that isn't "solved" or that not many have ever really worked on.
- eganist 7y ago> The way the different states are colored according to their time zone and then that color reaching out to the labels on top with those ray-like things is actually pretty clever. So the different components of this visualization genuinely solve a few different problems around color-blindness (necessary for 508 compliance is my guess, but I'm not an expert here) Grab a screenshot (https://i.imgur.com/9ynIz5G.jpg https://i.imgur.com/9ynIz5G.jpg) and drop it in here (https://www.color-blindness.com/coblis-color-blindness-simulator/ https://www.color-blindness.com/coblis-color-blindness-simul...) The only mode where any two zones next to each other are nearly identical is Red-blind/Protanopia (CMK identical, Y 8% higher in UTC-7 compared to UTC-8†). Monochromacy/Achromatopsia is a close second... and that's where the gradients to the clocks come in - even for those users, there's still a mechanism to distinguish those two zones. I'd guess some serious usability research went into this. --- † RGB, though more accurate since we're talking about a screen, would've been a little more complicated to compare in writing since only yellow changed between the two in CMYK
- xwowsersx 7y agoVery interesting, thanks for the color-blindness link.
- jryb 7y ago> I'd guess some serious usability research went into this. I find that unlikely. If they just swapped the blue color of Alaska with the Mountain time zone there would be no ambiguity between adjacent colors at all for any type of color blindness.
- NelsonMinar 7y agoPleased to see they retained support for properly displaying :60 seconds during the leap second.