My first guess would be something else is happening on disk at the same time (or over the network), a 1.5% timing variation between runs is well within that range. Run it multiple times if you're curious and get some broader stats.
Also, gut feeling, try Kurian's code, but move the time.time() call before the print statement such as: import time import maya.cmds as cmds curTime = time.time() fileToOpn = "/some/fld/somefile.mb" cmds.file(fileToOpn, o=True,f=True) doneTime = time.time() print "%s to %s seconds" % (fileToOpn, doneTime - curTime) This will stop your timer after you've finished the file open op, whereas previously I would not be at all surprised if you're timing both the file open operation *and* the output to console, where console outputs are relatively expensive in the grand scheme of things. On Wed, Jul 8, 2015, at 01:55 PM, likage wrote: > Thanks guys, that is what I am looking for :D > > Will take a look into Maya API though it may take me a while to digest > it since I am not at all familiar with it. > > I have a question though. > > While using the 2 methods as suggested by Justin and Kurlan, the > output results that I have obtained from both methods are slightly > different. Justin's method gave me 44.0617549419 while Kurlan's method > gave me 44.7263860703 > > Though the difference is very minor, was wondering if anyone could > tell me why is there a 0.7 gap? I am pretty curious in it seeing that > the coding for both method is almost the same... > > > -- > You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/996f39be-dbb6-400c-a2bb-e3394cbdc6d8%40googlegroups.com[1]. > For more options, visit https://groups.google.com/d/optout. Links: 1. https://groups.google.com/d/msgid/python_inside_maya/996f39be-dbb6-400c-a2bb-e3394cbdc6d8%40googlegroups.com?utm_medium=email&utm_source=footer -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1436328526.1427936.317973105.67F448F6%40webmail.messagingengine.com. For more options, visit https://groups.google.com/d/optout.
