mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1197145 - Added BaseTimeDuration::IsZero(), BaseTimeDuration::operator bool(), TimeStamp::operator bool(). r=nfroyd
This commit is contained in:
parent
64ca09e65d
commit
f4b3f4ca3e
@ -258,6 +258,14 @@ public:
|
|||||||
{
|
{
|
||||||
return mValue != aOther.mValue;
|
return mValue != aOther.mValue;
|
||||||
}
|
}
|
||||||
|
bool IsZero() const
|
||||||
|
{
|
||||||
|
return mValue == 0;
|
||||||
|
}
|
||||||
|
explicit operator bool() const
|
||||||
|
{
|
||||||
|
return mValue != 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Return a best guess at the system's current timing resolution,
|
// Return a best guess at the system's current timing resolution,
|
||||||
// which might be variable. BaseTimeDurations below this order of
|
// which might be variable. BaseTimeDurations below this order of
|
||||||
@ -413,6 +421,15 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool IsNull() const { return mValue == 0; }
|
bool IsNull() const { return mValue == 0; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if this is not the "null" moment, may be used in tests, e.g.:
|
||||||
|
* |if (timestamp) { ... }|
|
||||||
|
*/
|
||||||
|
explicit operator bool() const
|
||||||
|
{
|
||||||
|
return mValue != 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a timestamp reflecting the current elapsed system time. This
|
* Return a timestamp reflecting the current elapsed system time. This
|
||||||
* is monotonically increasing (i.e., does not decrease) over the
|
* is monotonically increasing (i.e., does not decrease) over the
|
||||||
|
Loading…
Reference in New Issue
Block a user