blob: cef7473451c09369996fe0be33e69ec684f3366f [file] [log] [blame]
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "util.h"
namespace goldfish {
namespace util {
ahg20::ElapsedRealtime makeElapsedRealtime(long long timestampNs) {
ahg20::ElapsedRealtime ts = {
.flags = ahg20::ElapsedRealtimeFlags::HAS_TIMESTAMP_NS |
ahg20::ElapsedRealtimeFlags::HAS_TIME_UNCERTAINTY_NS,
.timestampNs = static_cast<uint64_t>(timestampNs),
.timeUncertaintyNs = 1000000
};
return ts;
}
} // namespace util
} // namespace goldfish