Skip to content

Instantly share code, notes, and snippets.

@adamconroy
Created July 24, 2019 15:53
Show Gist options
  • Save adamconroy/d491b8efecc991a51626b5167b544aee to your computer and use it in GitHub Desktop.
Save adamconroy/d491b8efecc991a51626b5167b544aee to your computer and use it in GitHub Desktop.
Simple timer
<html>
<head>
<style>
body {
background-color: black;
}
#timer {
color: magenta;
font-size: 1000px;
text-align: center;
}
</style>
<script type='text/javascript'>
var timer = 0;
function getTimer() {
return document.getElementById('timer');
}
setInterval(function() {
timer++;
getTimer().innerHTML = '' + timer;
}, 1000);
</script>
</head>
<body>
<div id='timer'>0</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment