public
Description: wxWidgets Python bindings
Homepage: http://code.google.com/p/wxpy
Clone URL: git://github.com/kevinwatters/wxpy.git
wxpy / speedtest.py
100644 29 lines (18 sloc) 0.441 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import wx
from time import clock
 
print wx.__file__
 
N = 1000000
 
 
def timeit(callable, n = N):
    start = clock()
    for x in xrange(n):
        callable()
    return clock() - start
    
def timed(callable, n = N):
    elapsed = timeit(callable, n)
    print callable.__name__, elapsed
 
def test_gdi():
    
    def recttest():
        r = wx.Rect(2, 4, 6, 8)
    
    timed(recttest)
    
if __name__ == '__main__':
    test_gdi()