Created
October 24, 2014 04:06
-
-
Save ccanepa/afff47be7e4563841e45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import timeit | |
setup = ( | |
"import cocos.collision_model as cm;" + | |
"import cocos.euclid as eu;" + | |
"rect1 = cm.AARectShape(eu.Vector2(1.0, 1.0), 2.0, 3.0);" + | |
"rect2 = cm.AARectShape(eu.Vector2(3.0, 3.0), 2.0, 3.0)") | |
res = timeit.repeat(stmt="a = rect1.distance(rect2)", setup=setup, repeat=3, number=1000000) | |
print(res) | |
print(min(res)) | |
##Results, py2.6 | |
## | |
##with cocos master: 2.88287998255 | |
##with cocos daniel: 9.71700318483 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment