From 3debf6e5063b03dc620d2ed67c6c155245bfedd8 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Tue, 6 Dec 2016 11:02:35 +0100 Subject: [PATCH] Added a proper error when trying to print the timing for an undecorated model. --- profiler.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profiler.lua b/profiler.lua index 4fec258..f57c9d8 100644 --- a/profiler.lua +++ b/profiler.lua @@ -115,6 +115,10 @@ function profiler.print(model, nbSamples, totalTime, indent) local indent = indent or '' local hint + if not model.accTime then + error('The model does not seem decorated for profiling.') + end + local localTotal = 0 for _, t in pairs(model.accTime) do localTotal = localTotal + t -- 2.20.1