-function profiler.print(model, nbSamples)
- print('----------------------------------------------------------------------')
- print(model)
- if nbSamples then
- print(string.format('acc_time %.02fs (%.01fmus/sample)',
- model.accTime,
- 1e6 * model.accTime / nbSamples))
- else
- print(string.format('acc_time %.02fs', model.accTime))
+function profiler.print(model, nbSamples, indent)
+ local indent = indent or ''
+
+ print(string.format('%s* %s', indent, model.__typename))
+
+ for l, t in pairs(model.accTime) do
+ local s
+ if nbSamples then
+ s = string.format(' (%.01fmus/sample)', 1e6 * t / nbSamples)
+ else
+ s = ''
+ end
+ print(string.format('%s %s %.02fs%s', indent, l, t, s))