| width='120' | '''Signature'''
|<pre>prof:track(
$expression input as item()*, $options as map(*)? := ()map { }
) as item()*</pre>
|- valign="top"
| '''Summary'''
|Measures the execution time and memory consumption required for evaluating the specified {{Code|$expressioninput}} and returns a map with the results. The following {{Code|$options}} are available:
* {{Code|time}}: Include execution time in result as {{Code|xs:decimal}} (unit: milliseconds; default: true).
* {{Code|memory}}: Include memory consumption in result as {{Code|xs:integer}} (unit: bytes; default: false).
|- valign="top"
| '''Properties'''
|The function is ''non-deterministicnondeterministic'': evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
|
* Return a human-readable representation of the memory consumption caused by fetching an XML document. {{Function||fetch:doc}} is used, as <code>fn:doc</code> may already be evaluated at compilation time:
<syntaxhighlight pre lang="'xquery"'>
prof:track(fetch:doc('factbook.xml'))?memory
=> prof:human()
</syntaxhighlightpre>
* The function call <code>prof:track((1 to 1000000)[. mod 2 = 0], map { 'time': false() })</code> will return something similar to:
<syntaxhighlight pre lang="'xquery"'>
map {
"memory": 21548400,
"value": (2, 4, 6, 8, 10, ...)
}
</syntaxhighlightpre>
|}
| width='120' | '''Signature'''
|<pre>prof:time(
$expr input as item(), $label as xs:string ? := ()
) as item()*</pre>
|- valign="top"
| '''Summary'''
|Measures the time needed to evaluate {{Code|$exprinput}} and outputs a string to standard error or, if the GUI is used, to the Info View. An optional {{Code|$label}} may be specified to tag the profiling result. See {{Function||prof:track}} for further notes.
|- valign="top"
| '''Properties'''
|The function is ''non-deterministicnondeterministic'': evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
| width='120' | '''Signature'''
|<pre>prof:memory(
$expr input as item(), $label as xs:string ? := ()
) as item()*</pre>
|- valign="top"
| '''Summary'''
|Measures the memory allocated by evaluating {{Code|$exprinput}} and outputs a string to standard error or, if the GUI is used, to the Info View. An optional {{Code|$label}} may be specified to tag the profiling result. See {{Function||prof:track}} for further notes.
|- valign="top"
| '''Properties'''
|The function is ''non-deterministicnondeterministic'': evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
|- valign="top"
| '''Properties'''
|In contrast to {{Code|fn:current-time()}}, the function is ''non-deterministicnondeterministic'' and returns different values every time it is called. Its evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
|- valign="top"
| '''Properties'''
|In contrast to {{Code|fn:current-time()}}, the function is ''non-deterministicnondeterministic'' and returns different values every time it is called. Its evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
| Measures the time of an expression:
<syntaxhighlight pre lang="'xquery"'>
let $ns1 := prof:current-ns()
return (
return $ms || ' ms'
)
</syntaxhighlightpre>
|}
| width='120' | '''Signature'''
|<pre>prof:dump(
$expr input as item()*, $label as xs:string ? := ()
) as empty-sequence()</pre>
|- valign="top"
| '''Summary'''
|Dumps a serialized representation of {{Code|$exprinput}} to {{Code|STDERR}}, optionally prefixed with {{Code|$label}}, and returns an empty sequence. If the GUI is used, the dumped result is shown in the [[Graphical User Interface#Visualizations|Info View]].
|- valign="top"
| '''Properties'''
|- valign="top"
| '''Properties'''
|The function is ''non-deterministicnondeterministic'': evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
| width='120' | '''Signature'''
|<pre>prof:runtime(
$name of option as xs:string as
) as xs:integer</pre>
|- valign="top"
| '''Summary'''
|Returns the value of the specified runtime {{Code|$option}}. The following options existare available:
* {{Code|max}}: Maximum memory that the Java virtual machine will attempt to use.
* {{Code|total}}: Total memory in the Java virtual machine (varies over time).
| width='120' | '''Signature'''
|<pre>prof:void(
$value input as item()*
) as empty-sequence()</pre>
|- valign="top"
| '''Summary'''
|Swallows all items of Absorbs the specified {{Code|$valueinput}} and returns an empty sequence. This function is helpful if some (often nondeterministic or side-effecting) code needs to be evaluated and if the resulting value is irrelevantnot required.
|- valign="top"
| '''Properties'''
|The function is ''non-deterministicnondeterministic'': evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
|- valign="top"
| '''Properties'''
|The function is ''non-deterministicnondeterministic'': evaluation order will be preserved by the compiler.
|}