Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/absl/time/internal/get_current_time_chrono.inc is written in an unsupported language. File is not indexed.

0001 // Copyright 2018 The Abseil Authors.
0002 //
0003 // Licensed under the Apache License, Version 2.0 (the "License");
0004 // you may not use this file except in compliance with the License.
0005 // You may obtain a copy of the License at
0006 //
0007 //      https://www.apache.org/licenses/LICENSE-2.0
0008 //
0009 // Unless required by applicable law or agreed to in writing, software
0010 // distributed under the License is distributed on an "AS IS" BASIS,
0011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0012 // See the License for the specific language governing permissions and
0013 // limitations under the License.
0014 
0015 #include <chrono>
0016 #include <cstdint>
0017 
0018 namespace absl {
0019 ABSL_NAMESPACE_BEGIN
0020 namespace time_internal {
0021 
0022 static int64_t GetCurrentTimeNanosFromSystem() {
0023   return std::chrono::duration_cast<std::chrono::nanoseconds>(
0024              std::chrono::system_clock::now() -
0025              std::chrono::system_clock::from_time_t(0))
0026       .count();
0027 }
0028 
0029 }  // namespace time_internal
0030 ABSL_NAMESPACE_END
0031 }  // namespace absl