Kea  1.9.9-git
chrono_time_utils.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef KEA_CHRONO_TIME_UTILS_H
8 #define KEA_CHRONO_TIME_UTILS_H
9 
10 #include <chrono>
11 #include <string>
12 
13 namespace isc {
14 namespace util {
15 
18 const size_t MAX_FSECS_PRECISION = 6;
19 
28 std::string clockToText(std::chrono::system_clock::time_point t,
29  size_t fsecs_precision = MAX_FSECS_PRECISION);
30 
41 template<typename Duration>
42 std::string durationToText(Duration dur,
43  size_t fsecs_precision = MAX_FSECS_PRECISION);
44 
45 } // end of isc::util namespace
46 } // end of isc namespace
47 
48 #endif
std::string durationToText(boost::posix_time::time_duration dur, size_t fsecs_precision=MAX_FSECS_PRECISION)
Converts StatsDuration to text.
Defines the logger used by the top-level component of kea-dhcp-ddns.
const size_t MAX_FSECS_PRECISION
The number of digits of fractional seconds supplied by the underlying class, boost::posix_time.
std::string clockToText(std::chrono::system_clock::time_point t, size_t fsecs_precision)
Converts chrono time point structure to text.