diff --git a/Profiler/Profiler.ts b/Profiler/Profiler.ts index ca43d31..b6d3e49 100644 --- a/Profiler/Profiler.ts +++ b/Profiler/Profiler.ts @@ -39,9 +39,9 @@ export function init(): Profiler { delete Memory.profiler.start; return "Profiler stopped"; }, - - toString() { - return "Profiler.start() - Starts the profiler\n" + + + help() { + return "Profiler.start() - Starts the profiler\n" + "Profiler.stop() - Stops/Pauses the profiler\n" + "Profiler.status() - Returns whether is profiler is currently running or not\n" + "Profiler.output() - Pretty-prints the collected profiler data to the console\n" + diff --git a/Profiler/typings.d.ts b/Profiler/typings.d.ts index a022a30..999cbef 100644 --- a/Profiler/typings.d.ts +++ b/Profiler/typings.d.ts @@ -19,6 +19,7 @@ interface Profiler { start(): void; status(): void; stop(): void; + help(): void; } declare const __PROFILER_ENABLED__: boolean; diff --git a/README.md b/README.md index c38538d..d01437e 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ DesirePathProcess:findRoad 14 0.82ms 0.05 ## Setup -- Add the `Profiler` folder to your project directory somewhere. +- Add the `Profiler` folder to your project directory somewhere. - Import `Profiler` in your `main.ts` ```typescript @@ -69,7 +69,7 @@ DesirePathProcess:findRoad 14 0.82ms 0.05 public someMethod() { /* */ } } ``` - + - The script also expects a global constant `__PROFILER_ENABLED__` to be set. This is meant to be configured by build scripts. If this value is set to `false`, **Profiler** will be completely disabled on the build. ## Usage @@ -89,3 +89,5 @@ From the command line: **`Profiler.status()`** - Returns whether is profiler is currently running or not **`Profiler.output()`** - Pretty-prints the collected profiler data to the console + +**`Profiler.help()`** - Lists available profiler commands