Changeset 69950 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Dec 6, 2017 10:43:06 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/TM.cpp
r69111 r69950 2810 2810 VMMR3_INT_DECL(PRTTIMESPEC) TMR3UtcNow(PVM pVM, PRTTIMESPEC pTime) 2811 2811 { 2812 /* Get a stable set of VirtualSync parameters before querying UTC. */ 2812 /* 2813 * Get a stable set of VirtualSync parameters and calc the lag. 2814 */ 2813 2815 uint64_t offVirtualSync; 2814 2816 uint64_t offVirtualSyncGivenUp; … … 2822 2824 uint64_t const offLag = offVirtualSync - offVirtualSyncGivenUp; 2823 2825 2826 /* 2827 * Get current time and adjust for virtual sync lag and do time displacement. 2828 */ 2824 2829 RTTimeNow(pTime); 2825 2830 RTTimeSpecSubNano(pTime, offLag); 2826 2831 RTTimeSpecAddNano(pTime, pVM->tm.s.offUTC); 2832 2833 /* 2834 * Log details if the time changed radically (also triggers on first call). 2835 */ 2836 int64_t nsPrev = ASMAtomicXchgS64(&pVM->tm.s.nsLastUtcNow, RTTimeSpecGetNano(pTime)); 2837 int64_t cNsDelta = RTTimeSpecGetNano(pTime) - nsPrev; 2838 if (RT_ABS(cNsDelta) > RT_NS_1HOUR / 2) 2839 LogRel(("TMR3UtcNow: nsNow=%RI64 nsPrev=%RI64 -> cNsDelta=%RI64 (offLag=%RI64 offVirtualSync=%RU64 offVirtualSyncGivenUp=%RU64)\n", 2840 RTTimeSpecGetNano(pTime), nsPrev, cNsDelta, offLag, offVirtualSync, offVirtualSyncGivenUp)); 2841 2827 2842 return pTime; 2828 2843 }
Note:
See TracChangeset
for help on using the changeset viewer.