Problem of the Day
A new programming or logic puzzle every Mon-Fri

Typing Throttle

When implementing features such as auto completion it can be important to not send a request to the server each time a key is pressed. To do this many websites implement something called throttling to only send requests if a key hasn't been pressed in x milliseconds. Your goal is to create a program that does this. When the throttled timer reaches 500ms print out everything in the buffer or text input. So if you're type 'abcd' in to a console really quickly (each keystroke happening in under 500ms) then 500ms passes, you would print 'abcd'.

Permalink: http://problemotd.com/problem/typing-throttle/

Comments:

Content curated by @MaxBurstein