Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
RunningBuffet
Oct 25, 2007

I'm asking this question for a friend who's trying to use javascript to run an experiment which gathers data through people going through the test. It's mainly on the whole signal to noise ratio testing, seeing how quickly people learn patterns and such.

I'm going to admit knowing gently caress all about javascript right here, but I figure the question is general enough that I can explain it well enough. I'm this close to just scrapping the javascript in general and rewriting it myself in some other programming language, but I figure that if I could find something, it would save a few hours of work.

See, in this experiment, reaction time is important, but there seems to be a variable amount of lag due to IE (or so he claims) trying to run and do things in the background, and FireFox is worse about it, so it throws off the reaction times recorded from the experiment.

What I'm curious as he is too is if there's a way to run javascript outside of a browser in some standalone format? Like a Java applet or somesuch? Basically just.. something that'll spawn a window that isn't dependent on a browser or something like that. He was pretty new to Javascript as well, so he wasn't sure what to use either, and again, I know nothing about Javascript, other than that it's used in websites.

I've looked around but I haven't found anything that seems to work well, so I figured I'd let myself look :downs: here and ask.

Adbot
ADBOT LOVES YOU

RunningBuffet
Oct 25, 2007

Supervillin posted:

Pretty sure any given browser's implementation of JavaScript is going to be faster than any given human's reaction time, but I could be wrong.

How is he trying to time stuff? Unless he's somehow blocking the browser with while(true) { ... }, time is time and will be pretty accurate. If nothing else the start time and end time would be "off" by approximately the same amount, if it's just due to browser overhead. Reaction time would be the difference between the two, so still accurate.

Can he just ask that they close other browser windows while testing whatrever he's testing? Or what else is running?

I was actually thinking that the overhead would be off by a similar amount and could simply be subtracted, but thanks for reminding me of that.

I'm actually going to try to get a hold of him to find out the exact problem he was having, I just remembered him asking me for help a little while ago. Those are some good ideas though, I'll have to pass them by him, and I'll have a follow-up of some sort when I do talk to him again about it.

RunningBuffet
Oct 25, 2007

Supervillin posted:

Pretty sure any given browser's implementation of JavaScript is going to be faster than any given human's reaction time, but I could be wrong.

How is he trying to time stuff? Unless he's somehow blocking the browser with while(true) { ... }, time is time and will be pretty accurate. If nothing else the start time and end time would be "off" by approximately the same amount, if it's just due to browser overhead. Reaction time would be the difference between the two, so still accurate.

Can he just ask that they close other browser windows while testing whatrever he's testing? Or what else is running?

Well, I got a bit more info, so I hope it helps towards actually figuring out a solution.

Hrm, apparently the problem is that he's wanting things down to the millisecond. The thing is that whenever the user clicks, he mentions there being a chance that the browser attempts to ping something and causes a 200 ms delay in the timing mechanism, and that it variably does this, making the data off at random. He's tried different ways of storing the data to avoid the ping possibly affecting it, and tried keeping the browsers he tested (IE and Firefox) in offline mode, but with no luck with that, either. Nothing else running.

He did mention though that even his usage of Javascript might be causing the problem, but I'm not sure.

RunningBuffet
Oct 25, 2007

Lumpy posted:

I suspect its your friend's code. Browsers don't randomly ping stuff, and JS can easily deal with ms response times.

Make sure your test doesn't start until after the document and DOM fully load, don't do any synchronus stuff while the test is running, and you'll be fine.

Alright, I'll see what I can do and pass on the info to him. Thanks a lot, the advice is much appreciated.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply