本文介绍了是否有加快monk​​eyrunner脚本执行的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有(在Jython中)特定monkeyrunner脚本,我用截屏或触摸特定的坐标。我的主要程序是用Perl编写的 ​​- 它只是执行monkeyrunner脚本时,它们的功能是需要的结果。
问题是在这样的方法迟缓:在monkeyrunner脚本每次我应该得到一个MonkeyDevice对象,并使用它:

I've got a particular monkeyrunner script (in Jython), which I use for taking screenshots or touching particular coordinates. My main program is written in Perl - it just executes monkeyrunner scripts when their functionality is need.
The problem is in slowness of such method: every time in monkeyrunner script I should get a MonkeyDevice object and work with it:

device = MonkeyRunner.waitForConnection()

和整个运作似乎从5〜9秒,这是我的计划很慢服用。结果
是否有工作(至少,触摸坐标)更​​快速的方法吗?结果
谢谢你。

And the whole operation seems to take from 5 to 9 seconds, which is very slow for my program.
Is there any way of working (at least, touching coordinates) more quickly?
Thank you.

推荐答案

等到你需要做的事情。

这将节省您每次你需要做的事情都重新启动MonkeyRunner的开销。你可以甚至可能使用此方法来养活MonkeyRunner你正在尝试做的动作。

This will save you the overhead of restarting MonkeyRunner each time you need to do something. You could probably even use this method to feed MonkeyRunner the actions that you are trying to do.

这篇关于是否有加快monk​​eyrunner脚本执行的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 06:45