File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ indexstoredb_symbol_location_path(indexstoredb_symbol_location_t loc) {
448
448
double
449
449
indexstoredb_symbol_location_timestamp (indexstoredb_symbol_location_t loc) {
450
450
auto obj = (SymbolLocation *)loc;
451
- // Up until C++20 the reference date of time_since_epoch is undefined but according to
451
+ // Up until C++20 the reference date of time_since_epoch is undefined but according to
452
452
// https://en.cppreference.com/w/cpp/chrono/system_clock most implementations use Unix Time.
453
453
// Since C++20, system_clock is defined to measure time since 1/1/1970.
454
454
// We rely on `time_since_epoch` always returning the nanoseconds since 1/1/1970.
@@ -676,13 +676,14 @@ indexstoredb_timestamp_of_latest_unit_for_file(
676
676
auto obj = (Object<std::shared_ptr<IndexSystem>> *)index ;
677
677
llvm::Optional<llvm::sys::TimePoint<>> timePoint = obj->value ->timestampOfLatestUnitForFile (fileName);
678
678
if (timePoint) {
679
- // Up until C++20 the reference date of time_since_epoch is undefined but according to
679
+ // Up until C++20 the reference date of time_since_epoch is undefined but according to
680
680
// https://en.cppreference.com/w/cpp/chrono/system_clock most implementations use Unix Time.
681
681
// Since C++20, system_clock is defined to measure time since 1/1/1970.
682
682
// We rely on `time_since_epoch` always returning the nanoseconds since 1/1/1970.
683
- return timePoint->time_since_epoch ().count ();
683
+ auto nanosecondsSinceEpoch = timePoint->time_since_epoch ().count ();
684
+ return static_cast <double >(nanosecondsSinceEpoch) / 1000 / 1000 / 1000 ;
684
685
}
685
686
return 0 ;
686
- }
687
+ }
687
688
688
689
ObjectBase::~ObjectBase () {}
You can’t perform that action at this time.
0 commit comments