Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm programming a jQuery functionality for doing a search on articles while the user is typing in the search field.

I implemented a bind in jQuery that at every keyup, it sets a clearTimeout and a setTimeout to the actual function doing the post to the server. This is because users can be writing something and I want to avoid multiple posts.

I got "stuck" with: from the user interface point of view, what time should I set for the setTimeout? I tried different times (1s, 1.5s, 0.5s) but I have to admit the choice seems kind of random to me.

This raised the broader question: Is there any reference or study that answers the question of what are the "optimal" times for dynamic web interfaces?

I only now noticed that I've used more timers before (e.g. slides), that were also chosen "randomly".

Putting in other terms, does anyone knows how to justify why a given event in web interface has (or should have) a specific delta-time or range of delta-times?

(I'm sorry if this question is not adequate to here, It seemed to me closer than SO.)

share|improve this question
2  
Do any of these links help: ux.stackexchange.com/search?q=wait+for+results+milliseconds –  dcaswell Sep 18 '13 at 17:58

2 Answers 2

Take a look at http://imlocation.wordpress.com/2007/12/05/how-fast-do-people-type/

If you take the median:

Median = 38 WPM = 228 characters/minute

This gives 3.8 characters per second on average.

So if you waited 0.26 seconds before sending the query you are not querying faster than the speed half of people can type. It all depends on your system and whether it can cope with the amount of requests generated at this rate if it so happens the users of your system are slower than this (if everyone is at this speed then there's no problem).

share|improve this answer

There is no specific delay time. But if you think about it, waiting 0.5s means that every 0.5s you'll request a post result from your server. Now multiply this post frequency for 10 simultaneous users, your server will receive around 20 requests per second. If the server have to search into a big database you'll have a lot of lag time between the request and response for each request. Your web-app will be very slow.

I think that you can take 1.5 second of timeout before sending the post request. A lot of IDE and programs are set by default with an autocompletion delay around 2 sec (Ex: Visual Studio, Sublime Text, Coda, etc.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.