Bug 1347348 (part 2) - Add a comment about the profiler's "startTime" field. r=mstange.

It took me some time to understand this snippet of code, so I wrote a comment
about it.

--HG--
extra : rebase_source : b25fc8384a4fe00df7d8a0585e7a1944226fa212
This commit is contained in:
Nicholas Nethercote 2017-03-14 16:47:18 +11:00
parent 0414a346c4
commit af3c0f7fd5

View File

@ -1128,6 +1128,9 @@ StreamMetaJSCustomObject(PS::LockRef aLock, SpliceableJSONWriter& aWriter)
bool asyncStacks = Preferences::GetBool("javascript.options.asyncstack");
aWriter.IntProperty("asyncstack", asyncStacks);
// The "startTime" field holds the number of milliseconds since midnight
// January 1, 1970 GMT. This grotty code computes (Now - (Now - StartTime))
// to convert gPS->StartTime() into that form.
mozilla::TimeDuration delta =
mozilla::TimeStamp::Now() - gPS->StartTime(aLock);
aWriter.DoubleProperty(