Add require('__profiler__/profiler.lua') to your mod to load the profiler, then use it as described in the README
Optionally, set No_Profiler_Commands = true before the require to prevent it registering its own commands, if you intend to provide your own remote interface for starting/stopping profiling.