4 ms·
For comparison, does someone want to post the source code to GMail's meter: "Over 10250.602608 megabytes (and counting) of free storage."
by VikingCoder 14y ago
For comparison, does someone want to post the source code to GMail's meter:
"Over 10250.602608 megabytes (and counting) of free storage."
- duskwuff 14y agoGMail's meter is fine -- it's displaying the state of a value which Google has decreed will increase at a set rate. Unlike Santorum's donations, it's not an unpredictable measurement.
- artursapek 14y agoIndeed. It looks like they have their goals set for a long time. http://i.imgur.com/WvYcq.jpg http://i.imgur.com/WvYcq.jpg It finds the closest entry in there to the current value of "new Date().getTime()". Then it just adds (what roughs out to) .000004 for every second's difference between the 0 value and the current getTime() value. So today it reads 10250 MB, which must come from index 2 of that array + enough seconds to add 10 MB and some. Definitely more legit than Santorum's. Here's the code for the counter (it's embedded in that HTML file) http://pastebin.com/8tebjT79 http://pastebin.com/8tebjT79 The actual subtractions of the current time from the one in the array seem to be more detailed than what's put on the page, which is being rounded. A sample of input for format(): 10250.60874337952 10250.608747448896 10250.608751518273 10250.608755583586 10250.608759652963 10250.608763722339 10250.608767787651
- duaneb 14y agoIIRC GMail's meter is updated at a rate which is actually accurate, and is simulated so that the page doesn't need to keep asking google for the capacity.