So I was fiddling around with this code I found a week ago due to its ability to 'somewhat' accomplish the look of what the old gmail file counter did. I've failed to make the counter accurately increase at a faster speed other than per seconds.
By editing the lowest 1000 [found at setTimeout(function(){thisobj.start()}, 1000) ] in the code the counter counts up much faster but when refreshed it reverts back to near where it started with an additional second or two (depending on the time from start to refresh).
<html>
<head>
<script type="text/javascript">
function countup(startingdate, base) {
this.currentTime = new Date();
this.startingdate = new Date(startingdate);
this.base = base;
this.start();
}
countup.prototype.oncountup = function(){};
countup.prototype.start = function() {
var thisobj = this,
timediff = (this.currentTime-this.startingdate) / 1000,
secondfield = Math.floor((timediff));
result = { seconds: secondfield };
this.currentTime.setSeconds(this.currentTime.getSeconds() + 1);
this.oncountup(result);
setTimeout(function(){
thisobj.start();
}, 1000);
};
</script>
</head>
<body>
<div id="holder"></div>
<script type="text/javascript">
var startDate = new countup("August 3, 2013 18:59:00", "seconds") // Change starting Date Here
startDate.oncountup= function(result) {
var mycountainer = document.getElementById("holder");
mycountainer.innerHTML =+ result['seconds'];
}
</script>
</body>
</html>
I'm fairly certain that this can be changed to count by milliseconds thus increasing at a faster speed that a certain amount per second.
Thanks in advance!