Bug 672207. Add toMicroseconds() for more precision. r=cjones
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 20 Jul 2011 13:38:34 -0400
changeset 73111 d1792672080512abb07c968630b9c26c827b58c7
parent 73110 6fd16e7c196bd25b13f3cbfc6dc4a8b1be6eecf9
child 73112 4053fa47daacec8cc298550eb5434d61efdce39e
push id20819
push usermak77@bonardo.net
push dateThu, 21 Jul 2011 12:32:52 +0000
treeherdermozilla-central@036c28e4e0f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs672207
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 672207. Add toMicroseconds() for more precision. r=cjones
xpcom/ds/TimeStamp.h
--- a/xpcom/ds/TimeStamp.h
+++ b/xpcom/ds/TimeStamp.h
@@ -73,16 +73,19 @@ public:
   double ToSeconds() const;
   // Return a duration value that includes digits of time we think to
   // be significant.  This method should be used when displaying a
   // time to humans.
   double ToSecondsSigDigits() const;
   double ToMilliseconds() const {
     return ToSeconds() * 1000.0;
   }
+  double ToMicroseconds() const {
+    return ToMilliseconds() * 1000.0;
+  }
 
   // Using a double here is safe enough; with 53 bits we can represent
   // durations up to over 280,000 years exactly.  If the units of
   // mValue do not allow us to represent durations of that length,
   // long durations are clamped to the max/min representable value
   // instead of overflowing.
   static inline TimeDuration FromSeconds(double aSeconds) {
     return FromMilliseconds(aSeconds * 1000.0);