title: Time difference between Elasticsearch "took" and that calculated manually
body: <p>I can't figure out why is there such a difference between ES time and the query time.</p>
  
  <pre><code>var url = "192.168.100.11:9200";
  var elasticsearch = require('elasticsearch');
  
  var client = new elasticsearch.Client({
      host: url
  });
  var accounts = [];   
  var startTime = new Date();
  client.search({"index":"test", "type":"testdata1", searchType:"count"}).then(
      function (searchData) {
          var endDate = new Date();
          console.log(" total time : [" + (endDate - startTime) + "]")
          console.log(" ES   &gt;&gt;&gt;&gt;&gt; :" + JSON.stringify(searchData.took));
      }).catch(function (err) {
          console.log(" errr  &gt;&gt;&gt;&gt; :" + err);
      });
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>total time : [37]</p>
    
    <p>ES   >>>>> :2</p>
  </blockquote>
  
  <p>As you can see, es result took shows query was executed in 2 ms, but if I calculate total time taken to run in code , it took 37ms. What took 35ms ?</p>