http://jsfiddle.net/SCyWG/63/
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
var timer,
def=19,
num = ('localStorage' in window)?(localStorage.getItem('timer-num')||def):def,
output = $('#mydiv');
function changeNum(){
output.text(num--);
if('localStorage' in window)
localStorage.setItem('timer-num',num);
//каждый раз задержка будет на 100ms больше
if(num>=0)
setTimeout(changeNum,500+(19-num)*100);
};
setTimeout(changeNum,500);
});
</script>
</head>
<body>
<div id="mydiv"></div>
</body>
</html>