timer_elapsed

Declaration

timer_elapsed (name: STRING)

Description

Returns, in seconds, the amount of time elapsed if name is an ascending timer and the amount of time remaining if name is a descending timer. If you have an ascending timer that has been running for 30 seconds, timer_elapsed returns 30. If it is a descending timer that counts from 2 minute, then timer_elapsed returns 90 (seconds).

There is a page tag called timer that can be connected to a timer to display its current elapsed time.

See Also

timer_value
timer (tag)
timer functions
Timer_Manager

Example

script finish_test is
  time_remaining := timer_elapsed ('test')
    -- figure out how much time is left
  if time_remaining > 1800 then
    -- more than half an hour left
    message ('you should take longer on this test', Message_info)
  end
  delete_timer ('test')
end