Changeset 26209 in vbox
- Timestamp:
- Feb 3, 2010 4:54:41 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57234
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/time.h
r25857 r26209 602 602 * 603 603 * @returns pTime. 604 * @param pTime Where to store the time.604 * @param pTime Where to store the time. 605 605 */ 606 606 RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime); 607 608 /** 609 * Sets the system time. 610 * 611 * @returns IPRT status code 612 * @param pTime The new system time (UTC). 613 * 614 * @remarks This will usually fail because changing the wall time is usually 615 * requires extra privileges. 616 */ 617 RTDECL(int) RTTimeSet(PCRTTIMESPEC pTime); 607 618 608 619 /** -
trunk/src/VBox/Runtime/Makefile.kmk
r26180 r26209 487 487 r3/posix/rand-posix.cpp \ 488 488 r3/posix/RTTimeNow-posix.cpp \ 489 r3/posix/RTTimeSet-posix.cpp \ 489 490 r3/posix/semrw-posix.cpp \ 490 491 r3/posix/thread-posix.cpp \ … … 558 559 r3/posix/process-posix.cpp \ 559 560 r3/posix/RTTimeNow-posix.cpp \ 561 r3/posix/RTTimeSet-posix.cpp \ 560 562 r3/posix/timelocal-posix.cpp \ 561 563 r3/posix/utf8-posix.cpp … … 589 591 r3/posix/RTFileQueryFsSizes-posix.cpp \ 590 592 r3/posix/RTSystemQueryOSInfo-posix.cpp \ 593 r3/posix/RTTimeSet-posix.cpp \ 591 594 r3/posix/dir-posix.cpp \ 592 595 r3/posix/env-posix.cpp \ … … 645 648 r3/posix/RTMpGetCount-posix.cpp \ 646 649 r3/posix/RTTimeNow-posix.cpp \ 650 r3/posix/RTTimeSet-posix.cpp \ 647 651 r3/posix/semevent-posix.cpp \ 648 652 r3/posix/semeventmulti-posix.cpp \ … … 682 686 r3/posix/rand-posix.cpp \ 683 687 r3/posix/RTTimeNow-posix.cpp \ 688 r3/posix/RTTimeSet-posix.cpp \ 684 689 r3/posix/semevent-posix.cpp \ 685 690 r3/posix/semeventmulti-posix.cpp \ … … 749 754 r3/posix/rand-posix.cpp \ 750 755 r3/posix/RTTimeNow-posix.cpp \ 756 r3/posix/RTTimeSet-posix.cpp \ 751 757 r3/posix/time-posix.cpp \ 752 758 r3/posix/timelocal-posix.cpp -
trunk/src/VBox/Runtime/r3/darwin/time-darwin.cpp
r15870 r26209 98 98 99 99 100 /**101 * Gets the current nanosecond timestamp.102 *103 * This differs from RTTimeNanoTS in that it will use system APIs and not do any104 * resolution or performance optimizations.105 *106 * @returns nanosecond timestamp.107 */108 100 RTDECL(uint64_t) RTTimeSystemNanoTS(void) 109 101 { … … 112 104 113 105 114 /**115 * Gets the current millisecond timestamp.116 *117 * This differs from RTTimeNanoTS in that it will use system APIs and not do any118 * resolution or performance optimizations.119 *120 * @returns millisecond timestamp.121 */122 106 RTDECL(uint64_t) RTTimeSystemMilliTS(void) 123 107 { … … 126 110 127 111 128 /**129 * Gets the current system time.130 *131 * @returns pTime.132 * @param pTime Where to store the time.133 */134 112 RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) 135 113 { -
trunk/src/VBox/Runtime/r3/win/time-win.cpp
r20736 r26209 136 136 137 137 138 /**139 * Gets the current nanosecond timestamp.140 *141 * This differs from RTTimeNanoTS in that it will use system APIs and not do any142 * resolution or performance optimizations.143 *144 * @returns nanosecond timestamp.145 */146 138 RTDECL(uint64_t) RTTimeSystemNanoTS(void) 147 139 { … … 150 142 151 143 152 /**153 * Gets the current millisecond timestamp.154 *155 * This differs from RTTimeNanoTS in that it will use system APIs and not do any156 * resolution or performance optimizations.157 *158 * @returns millisecond timestamp.159 */160 144 RTDECL(uint64_t) RTTimeSystemMilliTS(void) 161 145 { … … 164 148 165 149 166 /**167 * Gets the current system time.168 *169 * @returns pTime.170 * @param pTime Where to store the time.171 */172 150 RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) 173 151 { … … 179 157 180 158 181 /** 182 * Gets the current local system time. 183 * 184 * @returns pTime. 185 * @param pTime Where to store the local time. 186 */ 159 RTDECL(int) RTTimeSet(PCRTTIMESPEC pTime) 160 { 161 FILETIME FileTime; 162 SYSTEMTIME SysTime; 163 if (FileTimeToSystemTime(RTTimeSpecGetNtFileTime(pTime, &FileTime), &SysTime)) 164 { 165 if (SetSystemTime(&SysTime)) 166 return VINF_SUCCESS; 167 } 168 return RTErrConvertFromWin32(GetLastError()); 169 } 170 171 187 172 RTDECL(PRTTIMESPEC) RTTimeLocalNow(PRTTIMESPEC pTime) 188 173 { … … 197 182 198 183 199 /**200 * Gets the delta between UTC and local time.201 *202 * @code203 * RTTIMESPEC LocalTime;204 * RTTimeSpecAddNano(RTTimeNow(&LocalTime), RTTimeLocalDeltaNano());205 * @endcode206 *207 * @returns Returns the nanosecond delta between UTC and local time.208 */209 184 RTDECL(int64_t) RTTimeLocalDeltaNano(void) 210 185 { … … 221 196 222 197 223 /**224 * Explodes a time spec to the localized timezone.225 *226 * @returns pTime.227 * @param pTime Where to store the exploded time.228 * @param pTimeSpec The time spec to exploded. (UTC)229 */230 198 RTDECL(PRTTIME) RTTimeLocalExplode(PRTTIME pTime, PCRTTIMESPEC pTimeSpec) 231 199 {
Note:
See TracChangeset
for help on using the changeset viewer.