Counter test

(function(window, undefined) { function updateSongCount() { var startCount = 0, // Initial base count midnightToday = new Date().setHours(0,0,0,0), diffMs = Math.abs(Date.now() - midnightToday), diffMins = Math.floor((diffMs / 1000) / 60), e41Mins = Math.floor(diffMins / 41), // # of 41 min blocks in date difference newCount = startCount + e41Mins; document.getElementById(\'cm-songcount\').innerText = newCount; } setInterval(updateSongCount, 60000); updateSongCount(); }(window.self));