直接用减法就可以了
<script language="JavaScript">
<!--
oldtime= new Date()
setTimeout("newtime= new Date();alert(newtime-oldtime)",1000)
//-->
</script>