FbProfiler(name)

new FbProfiler(name)

Parameters:
Name Type Description
name string
Example
let test = new FbProfiler('test');
// do something time consuming
console.log(test.Time); // Outputs bare time in ms like "789"
test.Print(); // Outputs component name/version/assigned name like "Spider Monkey Panel v1.0.0: profiler (test): 789 ms"

Members

readonly Time :number

Methods

Print(additionalMsgopt, printComponentInfoopt)

Parameters:
Name Type Attributes Default Description
additionalMsg string <optional>
'' string that will be prepended to the measured time
printComponentInfo boolean <optional>
true
Example
let test = new FbProfiler('Group #1');
// Do smth #1
test.Print('\nTask #1:', false);
// Do smth #2
test.Print('\nTask #2:', false);
// Do smth
test.Print();
// Output:
// profiler (Group #1):
// Task #1: 789 ms"
// profiler (Group #1):
// Task #2: 1530 ms"
// Spider Monkey Panel v1.0.0: profiler (Group #1): 3541 ms"

Reset()