Skip to content

Instantly share code, notes, and snippets.

@brainfoolong
Last active June 21, 2021 07:22
Show Gist options
  • Save brainfoolong/5750da1529a88c6c4a125b0a157c5d46 to your computer and use it in GitHub Desktop.
Save brainfoolong/5750da1529a88c6c4a125b0a157c5d46 to your computer and use it in GitHub Desktop.
A simple stopwatch for your recordings in OBS Studio
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Brains Easy OBS Stopwatch</title>
</head>
<body>
<span id="watch"></span>
<script>
(function () {
// set this in seconds to start the timer above 0 seconds
var startOffset = 0
var startTime = new Date().getTime() - startOffset * 1000
var watch = document.getElementById('watch')
setInterval(function () {
var msElapsed = new Date().getTime() - startTime
var secondsElapsed = Math.floor(msElapsed / 1000)
var seconds = Math.floor(secondsElapsed % 60)
var minutes = Math.floor(secondsElapsed / 60 % 60)
var hours = Math.floor(secondsElapsed / 3600)
watch.innerText = hours + ':' + (minutes < 10 ? '0' : '') + minutes + ':' + (seconds < 10 ? '0' : '') + seconds
}, 500)
})()
</script>
<style type="text/css">
body {
font-family:Arial;
color: white;
font-size: 60px;
text-align: center;
padding: 0;
margin: 0;
text-shadow: black 0 0 10px, black 0 0 20px;
}
</style>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment