Efficiently calculate minutes and seconds for MM:ss formatted display from seconds, using OpenLaszlo / javascript? -
I am currently using the following function which is based on an example from the Web, The current progress through a video stream is called.
Is there something that I can do to make it more efficient?
Function secondsmomnet (seconds) {var s; If (secs> 60) {var min = Math.floor (sec / 60); S = min & lt; 10? "0": ""; S + = min + ":"; Secs = secs - min * 60; } And {s = "00:"; } If (second & lt; 10) {s + = "0" + monastery Floor (sec); } Else {s + = Math.floor (second); } Return S; }
function secondsmominates (seconds) {var mins = Math.floor ( Seconds / 60); Secs = secs% 60; Return (minutes & lt; 10? "0" + minutes: minutes) + ":" + (seconds & lt; 10? "0" + second: seconds); }
Comments
Post a Comment