cpicanco / stimulus_control

A teaching machine for free behavioral experiments
GNU General Public License v3.0
11 stars 7 forks source link

Improve time accurary system wide #13

Closed cpicanco closed 9 years ago

cpicanco commented 9 years ago

Now the program requires time handling for:

There is no implementation for high resolution range (10, 2, miliseconds and higher). I imagine the nanoseconds would be very good to EEG experiments. EpikTimer would be very good, but I don know if it will fit mac computers.

Is necessary to evaluate all the stuff and decide what is the best for each occasion.

cpicanco commented 9 years ago

37a1010b709ed9f22f75c1d50b1bcf656ca2f6d4 giving good results.

Old means before the new custom_timer and concurrent thread timing.

Old ITI Old Limited Hold
1011 2909
1004 2905
1002 2906
1004 3007
1005 3032
1003 3009
1031 3006
1003 2925
1004 3012
1003 2907
1005 2908
1003 2906
1004 2935
1005 2906
1003 2905
1003 2912
1007 2907
1003 2906
1003 2907
1039 2909
1026 3008
1003 2907
1005 3010
1004 3005
1004 2910
1004 2907
1004 2917
1004 2905
1015 2905
1031 2905
1006 2905
1014 2905
1007 2905
1014 2905
1007 2905
1006 2905
1011 2905
1007 2906
1029 2905
1032 2905
1032 2905
1031 2904
1006 2905
1008 2905
1031 2906
1012 2906
1018 2906
1028 2905
1010 2905
1012 2906
1003 2905
1016 2905
1014 2905
1008 2905
1012 2906
1003 2904
1024 2904
1006 2905
1019 2905
1012 2905
1018 2905
1015 2905
1003 2905
1023 2909
1004 2905
1030 2905
1026 2905
1016 2905
1011 2905
1023 2905
1003 2906

From this sample, I noticed that I need to investigate why STM (stimulus) difference (end - onset) consistently gets 100 ms less than the original parameter. Strange...

cpicanco commented 9 years ago

For high resolution time measurement, keeps cpu hz stable is essential. Its precision depends on the machine granularity as well (phisical properties, i think). It requires careful investigation.

www.makelinux.net/ldd3/chp-7-sect-1

https://aufather.wordpress.com/2010/09/08/high-performance-time-measuremen-in-linux/

http://man7.org/linux/man-pages/man2/clock_gettime.2.html

cpicanco commented 9 years ago

[c0920ac9990993daa6c3161488770c06571a2763] Done. Need some additional testing though.

cpicanco commented 9 years ago

New limited hold.

StmBegin StmEnd LimitedHold
1572 4575 3003
6086 9090 3004
10582 13585 3003
14946 17949 3003
19420 22423 3003
23822 26825 3003
28364 31368 3004
32946 35949 3003
37842 40845 3003
42346 45349 3003
46822 49825 3003
51289 54292 3003
69551 72554 3003
73975 76978 3003
78479 81482 3003
82843 85846 3003
87278 90280 3002
91658 94661 3003
96057 99060 3003
100459 103463 3004
104898 107901 3003
109335 112338 3003
113704 116708 3004
118065 121070 3005
122453 125456 3003
126856 129860 3004
131371 134374 3003
135963 138966 3003
140578 143582 3004
145073 148076 3003
149631 152634 3003
154264 157268 3004
158688 161691 3003
164382 167386 3004
180058 183061 3003
184504 187508 3004
188938 191942 3004
193572 196576 3004
198045 201049 3004
202449 205453 3004
206836 209839 3003
211323 214326 3003
215679 218684 3005
220109 223113 3004
224476 227479 3003
228848 231853 3005
233279 236283 3004
237770 240774 3004
242146 245150 3004
246644 249649 3005
252962 255966 3004
257501 260506 3005
262027 265031 3004
267704 270708 3004
272286 275291 3005
277497 280502 3005
282103 285107 3004
288693 291697 3004
294419 297423 3004
299168 302173 3005
303712 306716 3004
310548 313552 3004
316323 319327 3004
322388 325392 3004
329361 332365 3004
335866 338871 3005
345138 348142 3004
351577 354582 3005
357126 360131 3005
362079 365084 3005
367979 370984 3005
372937 375943 3006
cpicanco commented 9 years ago

Very good.

StmBegin StmEnd FT
711 2712 2001
4095 6096 2001
7518 9519 2001
10918 12918 2000
14302 16303 2001
17663 19664 2001
21002 23002 2000
24354 26355 2001
27676 29676 2000
31026 33027 2001
34387 36388 2001
37751 39752 2001
41103 43104 2001
44489 46490 2001
47512 49513 2001
50907 52908 2001
54622 56622 2000
58721 60722 2001
62102 64103 2001
65606 67607 2001
69028 71029 2001
72220 74221 2001
75660 77661 2001
79153 81154 2001
82612 84613 2001
86259 88259 2000
89490 91491 2001
93719 95720 2001
97008 99008 2000
100346 102347 2001
104480 106481 2001
109055 111056 2001
113856 115857 2001
117798 119798 2000
121976 123977 2001
126334 128335 2001
130367 132368 2001
139237 141238 2001
144885 146886 2001
167230 169231 2001
176697 178697 2000
182831 184833 2002
186494 188495 2001
190000 192001 2001
193423 195424 2001
196808 198809 2001
200206 202207 2001
203988 205990 2002
208290 210291 2001
213732 215733 2001
218122 220123 2001
222278 224280 2002
230066 232067 2001
235025 237026 2001
239309 241310 2001
242687 244689 2002
246089 248090 2001
249500 251501 2001
252951 254952 2001
256450 258451 2001
259960 261961 2001
265437 267439 2002
270990 272991 2001
279477 281478 2001
297088 299090 2002
300685 302686 2001
304139 306140 2001
417574 419575 2001
453201 455203 2002
456605 458606 2001
459989 461991 2002
463424 465425 2001
466813 468815 2002
469895 471896 2001
472978 474979 2001
476084 478086 2002
479150 481151 2001
482909 484911 2002
486272 488274 2002
489544 491545 2001
492761 494763 2002
496010 498012 2002
499357 501359 2002
502660 504661 2001
505898 507899 2001
509090 511091 2001
512270 514271 2001
515529 517531 2002
518932 520934 2002
522023 524024 2001
525104 527106 2002
528176 530177 2001
531773 533775 2002
536164 538166 2002
542683 544684 2001
546503 548505 2002