Simulate my keyboard I have an issue with my keyboard (more likely an issue with my browser). Some times when I click on a new text field and begin typing all my text comes out backwards.  After a very short amount of time (for the purpose of the challenge we will say it is 10 milliseconds) it resumes typing forwards again.  It seems that at first my cursor does not move when I begin to type so all the letters get inserted at the beginning of the textfield.

For example if I were typing python and I typed pyt in the first 10 milliseconds the result would be

hontyp


Task

Your job is to simulate this behavior in as few bytes as possible.

Input

You may take input in any reasonable method. You may not however take the input as two separate fields.  The 10 millisecond delay should start when the program begins to allow input.  That is you may have preprocessing to do before input is allowed, which should not be counted towards the 10 milliseconds.

Some leniency is permitted in the timing as long as it averages 10 milliseconds and is off by more than 1 milliseconds no more than 1% of the time on a reasonably speced computer.

Output

You may output the string in whatever method you see fit.  You may either update live as the user is typing or output the result after you are finished taking input (either by a newline or end of file ^D).

Test cases

Some of these were generated by this CMC in The Nineteenth Byte

First 10  | after   | result
bra         in-flak   in-flakarb
ap          ple       plepa
code-       golf      golf-edoc
no          ne        neon
we          st        stew
ai          med       media
draw        back      backward
VimScript, 48 47 bytes

Vim has some nice builtins for this. Requires Vim 8.



se ri|cal timer_start(10,{-&gt;execute("se ri&amp;")})


Expects text entered in insert mode, a very reasonable input for VimScript. Explanation:

se ri " short for 'set revins', or 'reverse insert'
cal timer_start(10, " Start a timer that fires after 10ms
                 {-&gt;execute("se ri&amp;")}) " Give it a lambda that unsets ri


My initial approach, se ri|sl10m|se ri&amp;, doesn't work because the text is buffered until after the sleep command, and I couldn't find a way around this.