From Wowpedia
Revision as of 03:11, 31 October 2014 by Mikk (talk | contribs) (→‎Details: Point out that multiple debugprofilestop() calls do NOT stop any timers, rather it is preferred to call it multiple times!)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Returns the amount of time since profiling was started.

elapsedMilliseconds = debugprofilestop();


Number - Time since profiling was started in milliseconds.


  • Debug profiling provides a high-precision timer that can be used to profile code.
  • Calling this function, despite its name, does NOT stop the timer. It simply returns the time since the previous debugprofilestart() call!
  • Note that if you are simply using this to profile your own code, it is preferable to NOT keep re-starting the timer since it will interfere with other addons doing the same. Instead, do this:
 local beginTime = debugprofilestop()
 -- do lots of stuff
 -- that takes lots of time
 local timeUsed = debugprofilestop()  -beginTime
 print("I used "..timeUsed.." milliseconds!")

See also