зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1331495 - Add an operator<< overload for TimeDuration. r=froydnj
MozReview-Commit-ID: dYKdlKI8Le --HG-- extra : rebase_source : a56ed17f1c505ca50e3a9bb9ad0e34a1060ef1ac
This commit is contained in:
Родитель
8729bf8af7
Коммит
c57de18781
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <algorithm> // for std::min, std::max
|
||||
#include <ostream>
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
@ -279,6 +280,11 @@ public:
|
|||
return mValue != 0;
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& aStream,
|
||||
const BaseTimeDuration& aDuration) {
|
||||
return aStream << aDuration.ToMilliseconds() << " ms";
|
||||
}
|
||||
|
||||
// Return a best guess at the system's current timing resolution,
|
||||
// which might be variable. BaseTimeDurations below this order of
|
||||
// magnitude are meaningless, and those at the same order of
|
||||
|
|
Загрузка…
Ссылка в новой задаче