如何测量Maya脚本的时间? [英] How to measure the time of a Maya script?

查看:106
本文介绍了如何测量Maya脚本的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MEL中实现了几种方法,我想评估其性能.有什么方法可以衡量一段代码的执行时间吗?等同于其他语言中的"getCurrentTime".

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.

推荐答案

自Maya启动以来,timerX()命令将为您提供几秒钟的时间,因此您可以抓住它并进行数学计算:

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

float $start = timerX();

这篇关于如何测量Maya脚本的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆