Mercurial > pub > dyncall > bindings
annotate python/pydc/examples/sintest.py @ 3:f5d4d5c2f750
- gemspec fix
author | cslag |
---|---|
date | Thu, 31 Dec 2015 20:24:53 +0100 |
parents | 0cfcc391201f |
children | bf5625bb6f05 |
rev | line source |
---|---|
0 | 1 import math |
2 import os | |
3 import pydc | |
4 | |
5 def f1(n): | |
6 for x in xrange(n): | |
7 math.sin(x) | |
8 # filter( math.sin, range(0,n) ) | |
9 | |
10 | |
11 libc = pydc.load("msvcrt") | |
12 fpsin = pydc.find(libc,"sin") | |
13 | |
14 def libcsin(x): pass | |
15 | |
16 def f2(n): | |
17 for x in xrange(n): | |
18 pydc.call(fpsin,"d)d",float(x)) | |
19 # libcsin(i) | |
20 | |
21 # filter( libcsin , range(0,n) ) | |
22 | |
23 | |
24 #b = os.times() | |
25 f1(10000000) | |
26 #f2(10000000) | |
27 e = os.times() | |
28 | |
29 print e | |
30 | |
31 | |
32 | |
33 |