Use QueryPerformanceCounter() timer instead of GetTickCount()

GetTickCount() has poor resolution according to MSDN docs (from
10 to 16 ms).
Use long for time storage instead of time_t

AFAIK time_t is an opaque type that is able to hold return value
timer(), which means it can be insufficient for out needs.

So we just stick to long.
Merge branch 'qpc'