+function profiler.timing(l, t, nbSamples, totalTime)
+ local s = string.format('%s %.02fs', l, t)
+ if totalTime then
+ s = s .. string.format(profiler.colors('blue') .. ' [%.02f%%]', 100 * t / totalTime)
+ end
+ if nbSamples then
+ s = s .. string.format(profiler.colors('green') .. ' (%.01fmus/sample)', 1e6 * t / nbSamples)
+ end
+ s = s .. profiler.colors('black')
+ return s
+end
+