我有一些JNotify的jython代码,如下所示:
mask = JNotify.FILE_CREATED | JNotify.FILE_DELETED | \
JNotify.FILE_MODIFIED | JNotify.FILE_RENAMED
class Listener(JNotifyListener):
def fileRenamed(self, wd, rootPath, oldName, newName):
pass
def fileModified(self, wd, root, name):
add_file(root, name)
def fileDeleted(self, wd, root, name):
add_file(root, name)
def fileCreated(self, wd, root, name):
add_file(root, name)
st = time.time()
JNotify.addWatch("some_path", mask, True, Listener())
print time.time - st完成代码大约需要98.4秒。
但是当我运行time java -jar jnotify-0.94.jar命令时,它非常快,花费不到1秒。
Jython和JNotify有什么问题?
发布于 2013-09-23 15:31:10
时间与文件的计数有关。不是Jython或JNotify的问题。
https://stackoverflow.com/questions/18961813
复制相似问题