Extend debug
Extensions to the debug module.
Functions
| printLoadedPackages () | Prints loaded modules to console. |
| time (func, ...) | Executes a function and records the time it takes. |
| benchmarkStart (name) | Starts a benchmark. |
| benchmarkStop (name[, message[, condition_func]]) | Stops a benchmark and prints the execution time. |
| drawPhysicsWorld (world) | Draw the physics world. |
Functions
- printLoadedPackages ()
- Prints loaded modules to console.
- time (func, ...)
-
Executes a function and records the time it takes.
Parameters:
- func function function to execute
- ... mixed function parameters
Returns:
- number execution time (seconds)
- ... function return result
- benchmarkStart (name)
-
Starts a benchmark.
Parameters:
- name string benchmark identifier
- benchmarkStop (name[, message[, condition_func]])
-
Stops a benchmark and prints the execution time.
Mssage can use
Parameters:
- name string benchmark identifier
- message string message to print. Use tokens {name} and {time} to print name and time. (optional)
- condition_func function condition function, signature function(benchmarktime). Only print message if it returns true. Useful for only printing messages if execution time exceeds a value. (optional)
- drawPhysicsWorld (world)
-
Draw the physics world.
Including bodies, fixtures, joints and contacts.
Parameters:
- world World physics world