Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var secs = 10760;
- var hora = document.getElementById('cronometro')
- var chamadas = document.getElementById('chamadas')
- var segundos = document.getElementById('segundos')
- var tma = document.getElementById('tma')
- var desvio = document.getElementById('desvio')
- setInterval(cronometro, 1000);
- function cronometro() {
- secs++;
- hora.innerHTML = [
- secs / 60 / 60, // horas
- (secs / 60) % 60, // minutos
- secs % 60 // segundos
- ].map(Math.floor).map(
- s => (s < 10) ? '0' + s : s
- ).join(':');
- segundos.innerHTML = secs;
- var tmaVal = secs / parseInt(chamadas.value, 10);
- tma.innerHTML = tmaVal;
- desvio.innerHTML = (((tmaVal / Math.floor(tmaVal - 1)) - 1) * 100).toFixed(2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement