UNPKG

keolis-services

Version:

Keolis services includes Microphone, Location, Voice Activity Detector, Heart rate through web bluetooth API, text to speech, stop watch with our own cloud.

34 lines (30 loc) 1.07 kB
let stopWatchPlaying = false; let StopWatch_Seconds = 0; let StopWatch_tens = 0; let StopWatch_interval; export const stopwatch_start = () => { stopWatchPlaying = true; clearInterval(StopWatch_interval); StopWatch_interval = setInterval(startTimer, 10); } export const stopwatch_stop = () => { stopWatchPlaying = false; clearInterval(StopWatch_interval); } export const stopwatch_reset = () => { stopWatchPlaying = false; clearInterval(StopWatch_interval); StopWatch_tens = "00"; StopWatch_Seconds = "00"; document.getElementById('keolis-stopwatch-tens').innerHTML = StopWatch_tens; document.getElementById('keolis-stopwatch-seconds').innerHTML = StopWatch_Seconds; } export const startTimer = () => { StopWatch_tens++; if (StopWatch_tens > 99) { StopWatch_Seconds++; StopWatch_tens = 0; } document.getElementById('keolis-stopwatch-tens').innerHTML = StopWatch_tens; document.getElementById('keolis-stopwatch-seconds').innerHTML = StopWatch_Seconds; }