It's not that advanced at all, unless you never worked with API's before. If you want, I can put comments in for you to show you what the code does.

Here is what these API's do:

The QueryPerformanceFrequency returns Ticks per second from the internal clock in the computer. The internal clock by the way is reseted every time the computer has rebooted.

The QueryPerformanceCounter returns the elaped time from the internal clock.

Hope this helps.