CallNtPowerInformation. It returns the "interrupt-time count, in 100-nanosecond units". To obtain the time since last wake, this needs to be subtracted from another value, but the documentation doesn't explain what other value can be used. In Windows 7,
GetTickCount64(which return time in milliseconds) work great. The combination even returns a good result after a bootup, when the system hasn't slept yet. Do not use
QueryPerformanceCounter. The latter will be close enough at first, but every time the system sleeps and wakes, additional error will accumulate.