Changes

Jump to navigation Jump to search
46 bytes removed ,  18:37, 1 December 2023
m
Text replacement - "<syntaxhighlight lang="xquery">" to "<pre lang='xquery'>"
|- 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>
|}
|<pre>prof:time(
$input as item(),
$label as xs:string ? := ()
) as item()*</pre>
|- valign="top"
|- valign="top"
| '''Properties'''
|The function is ''non-deterministicnondeterministic'': evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
|<pre>prof:memory(
$input as item(),
$label as xs:string ? := ()
) as item()*</pre>
|- valign="top"
|- 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>
|}
|<pre>prof:dump(
$input as item()*,
$label as xs:string ? := ()
) as empty-sequence()</pre>
|- valign="top"
|- valign="top"
| '''Properties'''
|The function is ''non-deterministicnondeterministic'': evaluation order will be preserved by the compiler.
|- valign="top"
| '''Examples'''
|- valign="top"
| '''Summary'''
|Swallows all items of Absorbs the specified {{Code|$input}} 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.
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu