BBjAPI::getFunctionDebugNanoTimes

Description

This method is used by the BBj Function Debugging subsystem.

Syntax

Return Value

Method

HashMap<String,Long>

getFunctionDebugNanoTimes()

Parameters

None.

Return Value

A map keyed by function name, containing all functions used during this BBjServices run (or since resetFunctionDebug() was called). This returns total execution time for each function, measured in nanoseconds.

Remarks

For complete details, see BBj Function Debugging.

Example

rem ' BBjAPI::getFunctionDebugNanoTimes Example

rem ' BBj Function Debugging
rem ' Enable by adding this setting to BBj.properties:
rem ' com.basis.bbj.funcs.debug=true
use com.basis.bbj.funcs.FunctionMgr
precision 9
print "com.basis.bbj.funcs.debug=",
print FunctionMgr.DEBUG
print "resetFunctionDebug()"
bbjapi().resetFunctionDebug()
print "Use some BBj functions...."
print cvs(sys,3)," ",rev
print date(0:"%hz:%mz:%sz %p")
a = sqr(2)
b = sqr(100)
c = len("The quick brown fox jumps over the lazy dog.")
d = len("")
print "Report function timing statistics...."
counts! = bbjapi().getFunctionDebugCounts()
times! = bbjapi().getFunctionDebugNanoTimes()
print counts!
print times!
iter! = counts!.entrySet().iterator()
while iter!.hasNext()
    entry! = iter!.next()
    func$ = entry!.getKey()
    count = entry!.getValue()
    nano = times!.get(func$)
    print func$," was used",count," time(s) for a total of",
    print nano/1000000," ms (average",nano/count/1000000," ms)"
wend
end

Sample Run

com.basis.bbj.funcs.debug=true

resetFunctionDebug()

Use some BBj functions....

LEVEL 6 REV 21.02

01:36:34 pm

Report function timing statistics....

{BBJAPI=1, CVS=1, DATE=1, LEN=2, REV=1, SQR=2, SYS=1}

{BBJAPI=4821, CVS=18971, DATE=204105, LEN=2742, REV=19530, SQR=89605, SYS=2259}

BBJAPI was used 1 time(s) for a total of .004821 ms (average .004821 ms)

CVS was used 1 time(s) for a total of .018971 ms (average .018971 ms)

DATE was used 1 time(s) for a total of .204105 ms (average .204105 ms)

LEN was used 2 time(s) for a total of .002742 ms (average .001371 ms)

REV was used 1 time(s) for a total of .01953 ms (average .01953 ms)

SQR was used 2 time(s) for a total of .089605 ms (average .0448025 ms)

SYS was used 1 time(s) for a total of .002259 ms (average .002259 ms)

 

READY

>

See Also

BBjAPI

BBj Function Debugging

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.