I'm trying to create a timer that exceeds 24 hours. So far I've used
var time = new Date (new Date().toDateString() + ' ' + t);
to take advantage of the formatting with time.toLocaleTimeString This thing can't take a t > 24 hours. Before I roll my own thingy, is there something far easier that I can use?
I guess that means nothing is already made and I have to set about parsing 26:23:54 for example, myself. Oh well. Oh and, I can never get setInterval to work. I know why its better than setTimeout, but on Chrome it acts funny for me. Not worth it to figure out why
the above works fine on my version of Chrome. I don't understand this: "I have to set about parsing 26:23:54 for example" - maybe if you could elaborate on what it was you are trying to do?
I guess that means nothing is already made and I have to set about parsing 26:23:54 for example, myself. Oh well. Oh and, I can never get setInterval to work. I know why its better than setTimeout, but on Chrome it acts funny for me. Not worth it to figure out why
Your approach, if something does not work you tackle it again from a different perspective. If you go about programming like the brute at the vending machine trying to get it to re-vend a drink it didn't vend by pressing the drinks button you want and thumping the machine, expect nothing to happen.
If your setIntervals are not working, what is it that you are doing that everyone else isn't?
You will see things like setInterval(function(){ ... },1000); where the blind function is spread across several lines which is always prone to breaking things if your syntax is out be even the littlest thing like a missing ; or typo in a function call, property or method.
You should never use a setTimeout for a repetitive task, thats what setInterval is for and people just fail to understand why which is simply the amount of lag the setTimeouts repetitive use introduces.
These small amounts build in to large errors in accuracy very quickly, this is within the system and no amount of efficient coding will eliminate this lag which can be as much as 250ms per actuation on older slower machines and as far as I am aware, this is still the case, a baseline lag between interpretation to actual output exists, it may be smaller but it still exists.
So giving up easily without investigating why your not able to get a setInterval to work when you say you can get a setTimeout to run, means you are obviously doing something additional to requirement or not doing enough, it depends.
If you post an example, you may get guidance as to why or what and how to avoid it in future.
We all have baggage to carry in life, unfortunately for me I always get the trolley with the wonky wheel...
Code:
Youre = {
STILL_not_getting_it:function(){
alert("YOU, the original poster / thread starter NEED to POST the code and NOT a LINK.");
},
MissingThePoint:function(msg){
alert("You're missing the point. " + msg);
}
}
Youre.STILL_not_getting_it();
Bookmarks