Projet agregation v2 » Historique » Version 2
Laurent GUERBY, 03/03/2012 09:27
1 | 1 | Laurent GUERBY | h1. Projet agregation v2 |
---|---|---|---|
2 | 1 | Laurent GUERBY | |
3 | 1 | Laurent GUERBY | [[Projet agregation]] |
4 | 1 | Laurent GUERBY | |
5 | 1 | Laurent GUERBY | h2. Divers |
6 | 1 | Laurent GUERBY | |
7 | 1 | Laurent GUERBY | * 1 Mbit/s = 83 frames de 1500 byte/sec = 1 frame de 1500 byte toutes les 12 ms |
8 | 1 | Laurent GUERBY | * l'augmentation de latence sur la ligne permet la detection de la saturation des buffer |
9 | 1 | Laurent GUERBY | * on peut mesurer les variations de latence en regardant les variations de difference de timestamp destination moins source |
10 | 2 | Laurent GUERBY | |
11 | 2 | Laurent GUERBY | Mesure du temps en python : time.time() |
12 | 2 | Laurent GUERBY | http://stackoverflow.com/questions/1938048/high-precision-clock-in-python |
13 | 2 | Laurent GUERBY | |
14 | 2 | Laurent GUERBY | <pre> |
15 | 2 | Laurent GUERBY | |
16 | 2 | Laurent GUERBY | guerby@pc2:~/work/tetaneutral.net/python/pa2$ cat ttime.py |
17 | 2 | Laurent GUERBY | import time |
18 | 2 | Laurent GUERBY | |
19 | 2 | Laurent GUERBY | N=1000 |
20 | 2 | Laurent GUERBY | l=[] |
21 | 2 | Laurent GUERBY | for i in xrange(N): |
22 | 2 | Laurent GUERBY | t1=time.time() |
23 | 2 | Laurent GUERBY | t2=time.time() |
24 | 2 | Laurent GUERBY | dt=t2-t1 |
25 | 2 | Laurent GUERBY | l.append(dt) |
26 | 2 | Laurent GUERBY | |
27 | 2 | Laurent GUERBY | l.sort() |
28 | 2 | Laurent GUERBY | print l[0],l[-1],l[N/2],l[9*N/10] |
29 | 2 | Laurent GUERBY | guerby@pc2:~/work/tetaneutral.net/python/pa2$ python ttime.py |
30 | 2 | Laurent GUERBY | 9.53674316406e-07 3.00407409668e-05 1.90734863281e-06 2.14576721191e-06 |
31 | 2 | Laurent GUERBY | guerby@pc2:~/work/tetaneutral.net/python/pa2$ python ttime.py |
32 | 2 | Laurent GUERBY | 9.53674316406e-07 1.19209289551e-05 1.90734863281e-06 2.14576721191e-06 |
33 | 2 | Laurent GUERBY | guerby@pc2:~/work/tetaneutral.net/python/pa2$ python ttime.py |
34 | 2 | Laurent GUERBY | 9.53674316406e-07 0.000508069992065 1.90734863281e-06 2.14576721191e-06 |
35 | 2 | Laurent GUERBY | </pre> |
36 | 2 | Laurent GUERBY | |
37 | 2 | Laurent GUERBY | => autour de 2 microsecondes en pratique |