Action:
|
Calculates and returns the amount of time elapsed since
timer:start was executed.
|
|
Filename:
|
kern/kern_scm/law_scm.cxx
|
|
Syntax:
|
(timer:get-time)
|
|
Arg Types:
|
None
|
|
Returns:
|
real
|
|
Description:
|
The commands
timer:start,
timer:end,
timer:show-time, and
timer:get-time are used to measure performance of some command or series of commands. They measure only the CPU time required to execute the command and not any delays that might incur from entering the commands into Scheme. They are used most often to determine the time required to execute one or more commands.
|
|
|
timer:get-time can be executed/interspersed any number of times throughout a command or series of commands.
|
|
|
You can also use
timer:show-time to display the amount of time elapsed since
timer:start was executed.
|
|
Example:
|
; timer:get-time
|
|
; Start the timer
|
|
(timer:start)
|
|
;; "timer on"
|
|
; Create a solid block.
|
|
(define blockA (solid:block
|
|
|
(position 0 0 0) (position 20 20 20)))
|
|
;; blockA
|
|
; Create another solid block
|
|
(define blockB (solid:block (position 0 0 0)
|
|
|
(position -20 -20 -20)))
|
|
;; blockB
|
|
;Stop timer.
|
|
(timer:end)
|
|
;; "timer off, use timer:get-time"
|
|
(timer:get-time)
|
|
;; 21.271
|