title: Using different API for different Windows versions efficiently
body: <p>I'm faced with the need to use a new Windows runtime function where it's available, and fall back to an older one where the new one doesn't exist. </p>
  
  <p>The code path is performance-critical. I need to call <code>GetSystemTimePreciseAsFileTime</code> if the platform (Windows 8 / Windows Server 2012) offers it, and fall back to <code>GetSystemTimeAsFileTime</code> if the newer version doesn't exist.</p>
  
  <p>I'm aware that I can use <code>LoadLibrary</code> and <code>GetProcAddress</code> to load <code>GetSystemTimePreciseAsFileTime</code> and if that fails, fall back to <code>GetSystemTimeAsFileTime</code>. I'm concerned about the performance impact of calling something as performance-criticial as this though another layer of indirection though.</p>
  
  <p>Is there any built-in mechanism to lazy load a symbol, not a whole DLL? So I can test the Windows version at startup and call a function that uses <code>GetSystemTimePreciseAsFileTime</code> on Win8, otherwise call the one that uses <code>GetSystemTimeAsFileTime</code>, without causing the whole executable to fail with a link error on older Windows versions?</p>
  
  <p>Or should I just stop worrying and use <code>GetProcAddress</code>?</p>