Returns the value of the profiling timer


See also Debugging and Profiling functions.

Signature:

time = debugprofilestop()

Returns:

  • time - Current value of the profiling timer (in milliseconds, with sub-millisecond precision) (number)

Examples:

-- can be used to test the efficiency of a segment of code:
function myFunction()
  local startTime = debugprofilestop()

  -- function body goes here

  print(format("myFunction executed in %f ms", debugprofilestop()-startTime))
end