Output Module
Revision as of 12:04, 6 December 2010 by 134.34.226.134 (talk) (Created page with "<p>This module offers utility methods, which can be used for testing and profiling the code. All functions are preceded by the <code>util:</code> prefix. </p> ==util:eval== <t...")
This module offers utility methods, which can be used for testing and profiling the code. All functions are preceded by the util:
prefix.
Contents
util:eval
Signatures |
|
Summary |
Evaluates the argument at runtime. |
Rules |
This function dynamically evaluates $expr as XQuery expression and returns the resulting items. |
Examples |
The expression util:eval("1+3") returns 4 . |
util:run
Signatures |
|
Summary |
Opens the argument as file and evaluates it as at runtime. |
Rules |
This function opens $input as file, evaluates it as XQuery expression, and returns the resulting items. |
util:mb
Signatures |
|
Summary |
Measures the memory consumption for evaluating the argument. |
Rules |
This function measures the amount of memory that is needed to evaluate $expr . If the value of $cache is true() , the result will be cached. The returned xs:double value represents the amount of memory in megabytes. |
Examples |
The expression util:mb("1 to 100000") might return 0 .The expression util:mb("1 to 100000", true()) might return 26.678 . |
util:ms
Signatures |
|
Summary |
Measures the time needed for evaluating the argument. |
Rules |
This function measures the time needed to evaluate $expr . If the value of $cache is true() , the result will be cached. The returned xs:double value represents the needed time in milliseconds. |
Examples |
The expression util:ms("1 to 100000") might return 25.69 .The expression util:ms("1 to 100000", true()) might return 208.12 . |