Search code examples
performancemayamel

How to measure the time of a Maya script?


I have several methods implemented in MEL, and I would like to measure its performance. Is there any way to measure execution time of a fragment of code? Something equivalent to "getCurrentTime" in other languages.


Solution

  • the timerX() command will give you seconds since Maya was started, so you can grab that and do the math:

    float $start = timerX();