You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 4, 2018. It is now read-only.
Some applications need to use high resolution time because the time is sensitive some applications, like video stream. I known that use high resolution time is affect the performance. So maybe it can be optional on windows platform.
First the uv_loop_t add new flag for identify use high resolution time or not. Second, when uv_run() call uv_update_time() check the flag use uv_hrtime() or GetTickCount().
This is my suggestion and flexible for developers.
voiduv_update_time(uv_loop_t* loop) {
// --- Extend beginif (loop->use_hrtime == 1) {
loop->time = uv_hrtime()/1000000;
return;
}
// --- Extend end
DWORD ticks = GetTickCount();
/* The assumption is made that LARGE_INTEGER.QuadPart has the same type *//* loop->time, which happens to be. Is there any way to assert this? */
LARGE_INTEGER* time = (LARGE_INTEGER*) &loop->time;
/* If the timer has wrapped, add 1 to it's high-order dword. *//* uv_poll must make sure that the timer can never overflow more than *//* once between two subsequent uv_update_time calls. */if (ticks < time->LowPart) {
time->HighPart += 1;
}
time->LowPart = ticks;
}
The text was updated successfully, but these errors were encountered:
Some applications need to use high resolution time because the time is sensitive some applications, like video stream. I known that use high resolution time is affect the performance. So maybe it can be optional on windows platform.
First the uv_loop_t add new flag for identify use high resolution time or not. Second, when uv_run() call uv_update_time() check the flag use uv_hrtime() or GetTickCount().
This is my suggestion and flexible for developers.
The text was updated successfully, but these errors were encountered: