Difference between revisions of "ProfilingResult class"
CGHelpdesk (talk | contribs) (Created page with "{{CGscriptClass_Template |Name=<nowiki>ProfilingResult</nowiki> |Description=<nowiki>Class to view the current result of the profiling done.</nowiki> |Constructors= {{CGscriptCon...") |
CGHelpdesk (talk | contribs) |
||
Line 1: | Line 1: | ||
{{CGscriptClass_Template | {{CGscriptClass_Template | ||
− | |Name= | + | |Name=ProfilingResult |
− | |Description= | + | |Description=Class to view the current result of the profiling done. |
|Constructors= | |Constructors= | ||
− | {{CGscriptConstructors_Template|Description= | + | {{CGscriptConstructors_Template|Description=Get result of current script}} |
|Methods= | |Methods= | ||
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=Reset|Description=Remove all profiling results.}} |
− | {{CGscriptMethods_Template|ReturnType=string|Name= | + | {{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}} |
|Properties= | |Properties= | ||
− | {{CGscriptProperties_Template|ReturnType=AnyType|Name= | + | {{CGscriptProperties_Template|ReturnType=AnyType|Name=CompileTime|HasGetter=1|Description=Number of milliseconds spent on parsing script. Always recorded even if profiling has not been enabled.}} |
− | {{CGscriptProperties_Template|ReturnType=Dictionary|Name= | + | {{CGscriptProperties_Template|ReturnType=Dictionary|Name=CountResult|HasGetter=1|Description=Dictionary of line number and dictionary of line position and number of times executed. Lines not executed are not reported}} |
− | {{CGscriptProperties_Template|ReturnType=AnyType|Name= | + | {{CGscriptProperties_Template|ReturnType=AnyType|Name=DependecyGraphTime|HasGetter=1|Description=Number of milliseconds spent on calculating where expressions in bulk. Always recorded even if profiling has not been enabled.}} |
− | {{CGscriptProperties_Template|ReturnType=bool|Name= | + | {{CGscriptProperties_Template|ReturnType=bool|Name=EnableProfiling|HasGetter=1|HasSetter=1|Description=When set to true the duration and number of times a statement is executed is recorded.}} |
− | {{CGscriptProperties_Template|ReturnType=string|Name= | + | {{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}} |
− | {{CGscriptProperties_Template|ReturnType=array|Name= | + | {{CGscriptProperties_Template|ReturnType=array|Name=Script|HasGetter=1|Description=Array of lines in input script.}} |
− | {{CGscriptProperties_Template|ReturnType=Dictionary|Name= | + | {{CGscriptProperties_Template|ReturnType=Dictionary|Name=TimeResult|HasGetter=1|Description=Dictionary of line number and dictionary of line position (-1 == whole line) and time spent in milliseconds. Lines not executed are not reported}} |
− | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name= | + | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}} |
− | {{CGscriptProperties_Template|ReturnType=AnyType|Name= | + | {{CGscriptProperties_Template|ReturnType=AnyType|Name=WhereExpTime|HasGetter=1|Description=Number of milliseconds spent on calculating where expressions in bulk. Always recorded even if profiling has not been enabled.}} |
}} | }} | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | <source lang="javascript"> | ||
+ | ProfilingResult pr; | ||
+ | pr.EnableProfiling = true; | ||
+ | for(number i = 0; i < 100; i=i+1) | ||
+ | ; | ||
+ | print(pr.CompileTime); // 0.1198 | ||
+ | print(pr.CountResult); // {"4": {"0": 1, "4": 1}, "5": {"0": 100}, "7": {"4": 1}} | ||
+ | print(pr.DependecyGraphTime); // 0 | ||
+ | print(pr.TimeResult); // {"4": {"0": 0.0827, "-1": 0.0844, "4": 0.0017}, "5": {"0": 0.0102, "-1": 0.0102}, "7": {"-1": 0.006, "4": 0.006}, "8": {"-1": 0.0209, "4": 0.0209}, "9": {"-1": 0.0022, "4": 0.0022}} | ||
+ | print(pr.WhereExpTime); // 0 | ||
+ | </source> |
Revision as of 12:14, 17 October 2013
ProfilingResult
Class to view the current result of the profiling done.
Constructors
- () - Get result of current script
Methods
- Empty Reset() - Remove all profiling results.
- string ToString() - The string representation of the object.
Properties
- AnyType CompileTime { get; } - Number of milliseconds spent on parsing script. Always recorded even if profiling has not been enabled.
- Dictionary CountResult { get; } - Dictionary of line number and dictionary of line position and number of times executed. Lines not executed are not reported
- AnyType DependecyGraphTime { get; } - Number of milliseconds spent on calculating where expressions in bulk. Always recorded even if profiling has not been enabled.
- bool EnableProfiling { get; set; } - When set to true the duration and number of times a statement is executed is recorded.
- string ObjectTypeName { get; } - The name of the type of object.
- array Script { get; } - Array of lines in input script.
- Dictionary TimeResult { get; } - Dictionary of line number and dictionary of line position (-1 == whole line) and time spent in milliseconds. Lines not executed are not reported
- TypeInformation TypeInformation { get; } - Get information about this class.
- AnyType WhereExpTime { get; } - Number of milliseconds spent on calculating where expressions in bulk. Always recorded even if profiling has not been enabled.
Examples
ProfilingResult pr;
pr.EnableProfiling = true;
for(number i = 0; i < 100; i=i+1)
;
print(pr.CompileTime); // 0.1198
print(pr.CountResult); // {"4": {"0": 1, "4": 1}, "5": {"0": 100}, "7": {"4": 1}}
print(pr.DependecyGraphTime); // 0
print(pr.TimeResult); // {"4": {"0": 0.0827, "-1": 0.0844, "4": 0.0017}, "5": {"0": 0.0102, "-1": 0.0102}, "7": {"-1": 0.006, "4": 0.006}, "8": {"-1": 0.0209, "4": 0.0209}, "9": {"-1": 0.0022, "4": 0.0022}}
print(pr.WhereExpTime); // 0