Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: mozilla/nsprpub/pr/src/misc/prinrval.c

Issue 12089033: Update to NSPR 4.9.5 Beta 2, part 2: actual changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla/nsprpub/pr/src/misc/prerrortable.c ('k') | mozilla/nsprpub/pr/src/misc/prtime.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public 2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 5
6 /* 6 /*
7 * file: prinrval.c 7 * file: prinrval.c
8 * description: implementation for the kernel interval timing functions 8 * description: implementation for the kernel interval timing functions
9 */ 9 */
10 10
(...skipping 14 matching lines...) Expand all
25 #ifdef DEBUG 25 #ifdef DEBUG
26 { 26 {
27 PRIntervalTime ticksPerSec = PR_TicksPerSecond(); 27 PRIntervalTime ticksPerSec = PR_TicksPerSecond();
28 28
29 PR_ASSERT(ticksPerSec >= PR_INTERVAL_MIN); 29 PR_ASSERT(ticksPerSec >= PR_INTERVAL_MIN);
30 PR_ASSERT(ticksPerSec <= PR_INTERVAL_MAX); 30 PR_ASSERT(ticksPerSec <= PR_INTERVAL_MAX);
31 } 31 }
32 #endif /* DEBUG */ 32 #endif /* DEBUG */
33 } 33 }
34 34
35 /*
36 * This version of interval times is based on the time of day
37 * capability offered by system. This isn't valid for two reasons:
38 * 1) The time of day is neither linear nor montonically increasing
39 * 2) The units here are milliseconds. That's not appropriate for our use.
40 */
41
42 PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow(void) 35 PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow(void)
43 { 36 {
44 if (!_pr_initialized) _PR_ImplicitInitialization(); 37 if (!_pr_initialized) _PR_ImplicitInitialization();
45 return _PR_MD_GET_INTERVAL(); 38 return _PR_MD_GET_INTERVAL();
46 } /* PR_IntervalNow */ 39 } /* PR_IntervalNow */
47 40
48 PR_EXTERN(PRUint32) PR_TicksPerSecond(void) 41 PR_EXTERN(PRUint32) PR_TicksPerSecond(void)
49 { 42 {
50 if (!_pr_initialized) _PR_ImplicitInitialization(); 43 if (!_pr_initialized) _PR_ImplicitInitialization();
51 return _PR_MD_INTERVAL_PER_SEC(); 44 return _PR_MD_INTERVAL_PER_SEC();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 LL_USHR(rounding, tps, 1); 109 LL_USHR(rounding, tps, 1);
117 LL_MUL(tock, tock, usecPerSec); 110 LL_MUL(tock, tock, usecPerSec);
118 LL_ADD(tock, tock, rounding); 111 LL_ADD(tock, tock, rounding);
119 LL_DIV(tock, tock, tps); 112 LL_DIV(tock, tock, tps);
120 LL_L2UI(micro, tock); 113 LL_L2UI(micro, tock);
121 return micro; 114 return micro;
122 } /* PR_IntervalToMicroseconds */ 115 } /* PR_IntervalToMicroseconds */
123 116
124 /* prinrval.c */ 117 /* prinrval.c */
125 118
OLDNEW
« no previous file with comments | « mozilla/nsprpub/pr/src/misc/prerrortable.c ('k') | mozilla/nsprpub/pr/src/misc/prtime.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698