measureTime
measureTime(g_expression... ) =>l_result
Description
Measures the time needed to evaluate an expression and returns a list with performance data (n_utime, n_stime, n_clockTime, and x_pageFaults) for the executed expressions. This is a syntax form.
-
n_utime: The amount of user CPU time, in seconds, spent on the execution of expressions (counted with
getrusage()). -
n_stime: The amount of system CPU time, in seconds, spent on the execution of expressions (counted with
getrusage()). -
n_clockTime: The clock time used on execution of the expressions (in seconds) (counted with
gettimeofday()). This function assumes that the executed expressions do not altergetimeofday()result. -
x_pageFaults: The number of page faults that occurred during the execution of the expressions (counted with
gettimeofday()).
Arguments
Value Returned
|
A list with performance data (n_utime, n_stime, n_clockTime, and x_pageFaults) for the executed expressions. |
Examples
myList = nil ; Initializes the variable myList.
measureTime( for( i 1 10000 myList = cons(i myList) ) )
=> (0.4 0.05 0.4465 0)
Result indicates that it took .4 seconds and 0 page faults to build a list from 1 to 10,000 using cons.
myList = nil ; Initializes the variable myList.
measureTime( for( i 1 1000 myList = append1(myList i) ) )
=> (5.04 0.03 5.06 0)
Result indicates that it took 5 seconds and 0 page faults to build a list from 1 to 1000 using append1.
tab = makeTable("testTable" 'unbound 5000)
=> table:testTable
result = measureTime(for(i 0 10000 tab[i] = t))
=> (0.003 0.0 0.002537012 0)
Related Topics
Return to top