title: How stable is TSC (TimeStamp Counter) from user space for Intel x86-64 CPUs in 2020?
body: <p>Some times I need a proper way to measure performance at nanosecond from my user space application in order to include the syscall delays in my measurement. I read many old (10yo) articles saying it isn't any stable and they are gonna remove it from the user space.</p>
  
  <ul>
  <li>In 2020, for Intel 8th/9th generation x86-64 CPUs, how stable is it? Can we still use TSC assembly code in a safely manner?</li>
  <li>What the best practices to use TSC in the user space nowadays?</li>
  </ul>
  
  <p>Links: </p>
  
  <ul>
  <li><a href="https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/ia-32-ia-64-benchmark-code-execution-paper.pdf" rel="nofollow noreferrer">https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/ia-32-ia-64-benchmark-code-execution-paper.pdf</a></li>
  </ul>