title: Can I just get time as milliseconds without pain in C++?
body: <p>So I found <a href="https://stackoverflow.com/a/23616678/607407">this answer</a>. The way it constructs time looks weird (and imagine it without <code>auto</code>), but it <strong><a href="https://stackoverflow.com/a/31790604/607407">also doesn't work in Visual Studio 2010</a></strong>, because that MSVC version is too old. I don't get to chose what Visual Studio I use, so I need to stick to it. Visual studio error:</p>
  
  <pre><code>fatal error C1083: Cannot open include file: 'chrono': No such file or directory
  </code></pre>
  
  <p>So I had a look at the other answers, most of which declare like milion weird <code>struct</code>ures, use <code>totally::freaky&lt;time&gt; factories</code> because they are trying to get high precision time. I am pretty satisfied with time ± 5 milliseconds - I am measuring times from 100 - 5000 ms.</p>
  
  <p>So how do I get approximate system/cpu millisecond time using <strong>old C++ std libraries?</strong> (MSVC2010)</p>
  
  <p>PS.: In some logger files in our project, I found this:</p>
  
  <pre><code>datetimeEx(){
      time_t timer;
      time( &amp;timer );
      tm *t = localtime( &amp;timer );
      char tmp[32];
      sprintf(tmp, "%02d%02d%02d %02d%02d%02d", t-&gt;tm_year - 100, t-&gt;tm_mon + 1, t-&gt;tm_mday, t-&gt;tm_hour, t-&gt;tm_min, t-&gt;tm_sec);
      log &lt;&lt; tmp;
      return log;
  }
  </code></pre>
  
  <p>It produces time like this: <code>2015-11-02 16:53:57:<b>389</b></code> I played with it, but I couldn't get difference between two times.</p>