14: TSP command reference 2470 High Voltage SourceMeter Instrument
14-192 2470-901-01 Rev. A / May 2019
timer.cleartime()
This function resets the timer to zero (0) seconds.
Type TSP-Link accessible
Affected by Where saved Default value
Usage
timer.cleartime()
Example
dataqueue.add(35)
timer.cleartime()
delay(0.5)
dt = timer.gettime()
print("Delay time was " .. dt)
Clear the data queue, add 35 to it, and then
delay 0.5 seconds before reading it.
Output:
Delay time was 0.500099
35
Also see
timer.gettime() (on page 14-192)
timer.gettime()
This function measures the elapsed time since the timer was last cleared.
Type TSP-Link accessible
Affected by Where saved Default value
Usage
time = timer.gettime()
The elapsed time in seconds (1 µs resolution)
Example
dataqueue.add(35)
timer.cleartime()
delay(0.5)
dt = timer.gettime()
print("Delay time was " .. dt)
Clear the data queue, add 35 to it, and then
delay 0.5 seconds before reading it.
Output:
Delay time was 0.500099
35
Also see
timer.cleartime() (on page 14-192)