VBScript
Timer Function Example
The status bar shows (in the bottom left-hand corner of the window) the timer function which returns the number of seconds since 00:00:00 (midnight).
<!--
sub window_onload()
statuscounter()
end sub
sub statuscounter()
x = timer()
window.status = x
timer1 = window.settimeout("statuscounter()", 100)
end sub
-->
</script>
The touch typing tester uses this to calculate the time taken to type the sentence. The only problem with this occurs if the test is started before midnight and completed after midnight.
Notice that we have included a line in the script that checks for this and adds 86400 seconds to the result if midnight has passed.
- Beginners Tips
- Constants
- Scope of Variables
- Are comment tags needed?
- Combining VBScript & JavaScript
- Sub Procedure Order Ex1
- Variants and Subtypes
- Sub Procedure Order Ex2
- Seven Deadly Sins
- Timer Function Example
- Touch-type Speedometer
- Regular Expressions
- Browser and User Generated Events in Internet Explorer 4/5
Interested in programming, but don't know where to start? Beginning Programming will get you going! >> Go!
|
|
Out Now!