title: Time Interval between keydown and keyup events RXJS
body: <p>I want to get the timeInterval between keydown and keyup events for a each key pressed</p>
  
  <pre><code>var keyDowns = Rx.Observable.fromEvent(document, "keydown");
  var keyUps = Rx.Observable.fromEvent(document, "keyup");
  
  var keyPresses = keyDowns.merge(keyUps)
     //group by keycode, ie '87'= w
    .groupBy(e =&gt; e.keyCode)
     //map distinct keydowns and keyups - ideally, would want to get timeInterval after this
    .map(group =&gt; group.distinctUntilChanged(null, e =&gt; e.type))
     //flatten observable of key events observables
    .mergeAll()
  
  keyPresses.subscribe(function(e) {
      console.log(e.type, e.key);
      //console.log(e)
  });
  
  input: hold w, release w
  output: keydown w
          keyup w
  </code></pre>
  
  <p>I want to map these to an object structured like this</p>
  
  <pre><code>intervals = {'w-key': {
                 'press1': 1000ms
                 'press2': 1123ms
               }
               'd-key': {
                 'press1': 402ms
               }
              } 
  </code></pre>
  
  <p>Haalp please?</p>