Thank you all for your advices, it is highly appreciated!
Thanks SimonForsman, 60 fps is a good point too because I guess any game based on keyboard events in response to visual displays is intrisically limited in time accuracy by the fps.
So 16 ms is the best temporal resolution I can hope. And so JavaScript or Java are equally good to attain this precision.
Then my choice would depend on sensitiveness or occurences to/of lags. For that I answer to Satharis :
It'd probably help if you were more specific about what you're trying to accomplish, reading what you said could mean a lot of different things.
Lag could either be referring to internet lag or what most people assume, FPS lag, you could also mean lag in the delay time for timing something like a stopwatch, really rather vague. Additionally you're talking about something that has a lot of factors involved with whatever the program is, input lag could be a big contributor if its some kind of game and timing in and of itself is hard to accurately do due to delays in the program getting to loop again to check elapsed time due to things like OS scheduling or even the resolution of the timer you're using.
I'm not really sure you could peg any particular language as being "faster" at any specific task anyway, a lot of it comes down to the full product.
Yes, you're right. I'll try to be more specific:
Goals:
- accurately record the time elapsed between the presentation of a visual stimulus and a keyboard event
- present visual stimuli for precisely the time asked or the closest (e.g. 250 ms)
The potential sources of inaccuracies are then:
- delay in loading and presenting the visual stimulus ( --> the stimulus is presented 25 ms later than expected)
- delay for timing ( --> the stopwatch stops and records the time elapsed 25 ms later than expected)
- delay due to processing the line codes in general.
Would you favor a specific browser-compatible scripting language when accounting for these kinds of delay?
Thank you again for your help!