1e486d932ca5a10446a3c98d6d065213913277268John Reck/* 2e486d932ca5a10446a3c98d6d065213913277268John Reck * Copyright (C) 2015 The Android Open Source Project 3e486d932ca5a10446a3c98d6d065213913277268John Reck * 4e486d932ca5a10446a3c98d6d065213913277268John Reck * Licensed under the Apache License, Version 2.0 (the "License"); 5e486d932ca5a10446a3c98d6d065213913277268John Reck * you may not use this file except in compliance with the License. 6e486d932ca5a10446a3c98d6d065213913277268John Reck * You may obtain a copy of the License at 7e486d932ca5a10446a3c98d6d065213913277268John Reck * 8e486d932ca5a10446a3c98d6d065213913277268John Reck * http://www.apache.org/licenses/LICENSE-2.0 9e486d932ca5a10446a3c98d6d065213913277268John Reck * 10e486d932ca5a10446a3c98d6d065213913277268John Reck * Unless required by applicable law or agreed to in writing, software 11e486d932ca5a10446a3c98d6d065213913277268John Reck * distributed under the License is distributed on an "AS IS" BASIS, 12e486d932ca5a10446a3c98d6d065213913277268John Reck * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13e486d932ca5a10446a3c98d6d065213913277268John Reck * See the License for the specific language governing permissions and 14e486d932ca5a10446a3c98d6d065213913277268John Reck * limitations under the License. 15e486d932ca5a10446a3c98d6d065213913277268John Reck */ 16e486d932ca5a10446a3c98d6d065213913277268John Reck#ifndef UTILS_TIMEUTILS_H 17e486d932ca5a10446a3c98d6d065213913277268John Reck#define UTILS_TIMEUTILS_H 18e486d932ca5a10446a3c98d6d065213913277268John Reck 19e486d932ca5a10446a3c98d6d065213913277268John Reck#include <utils/Timers.h> 20e486d932ca5a10446a3c98d6d065213913277268John Reck 21e486d932ca5a10446a3c98d6d065213913277268John Recknamespace android { 22e486d932ca5a10446a3c98d6d065213913277268John Recknamespace uirenderer { 23e486d932ca5a10446a3c98d6d065213913277268John Reck 242d5b8d73929a38b019c6b6276d4a19542b990f0cJohn Reckconstexpr nsecs_t operator"" _s (unsigned long long s) { 252d5b8d73929a38b019c6b6276d4a19542b990f0cJohn Reck return seconds_to_nanoseconds(s); 262d5b8d73929a38b019c6b6276d4a19542b990f0cJohn Reck} 272d5b8d73929a38b019c6b6276d4a19542b990f0cJohn Reck 28e486d932ca5a10446a3c98d6d065213913277268John Reckconstexpr nsecs_t operator"" _ms (unsigned long long ms) { 29e486d932ca5a10446a3c98d6d065213913277268John Reck return milliseconds_to_nanoseconds(ms); 30e486d932ca5a10446a3c98d6d065213913277268John Reck} 31e486d932ca5a10446a3c98d6d065213913277268John Reck 322d5b8d73929a38b019c6b6276d4a19542b990f0cJohn Reckconstexpr nsecs_t operator"" _us (unsigned long long us) { 332d5b8d73929a38b019c6b6276d4a19542b990f0cJohn Reck return microseconds_to_nanoseconds(us); 342d5b8d73929a38b019c6b6276d4a19542b990f0cJohn Reck} 352d5b8d73929a38b019c6b6276d4a19542b990f0cJohn Reck 36e486d932ca5a10446a3c98d6d065213913277268John Reck} /* namespace uirenderer */ 37e486d932ca5a10446a3c98d6d065213913277268John Reck} /* namespace android */ 38e486d932ca5a10446a3c98d6d065213913277268John Reck 39e486d932ca5a10446a3c98d6d065213913277268John Reck#endif /* UTILS_TIMEUTILS_H */ 40