mirror of
https://github.com/facebook/sapling.git
synced 2024-12-25 05:53:24 +03:00
getting rid of Time.h
Summary: As titled, getting rid of Time.h and use std::chrono to compute the current time. Differential Revision: D21005713 fbshipit-source-id: 7e9d31af4b8652199bbe36b6ef76968cadcb4f2c
This commit is contained in:
parent
147de1f274
commit
27d32bff2f
@ -1,25 +0,0 @@
|
||||
// Copyright (c) 2007-present, Facebook, Inc.
|
||||
//
|
||||
// High resolution timers for wall clock and CPU time.
|
||||
|
||||
#ifndef COMMON_TIME_TIME_H
|
||||
#define COMMON_TIME_TIME_H
|
||||
|
||||
#include <ctime>
|
||||
#include <chrono>
|
||||
|
||||
using namespace std::chrono;
|
||||
|
||||
namespace facebook {
|
||||
|
||||
class WallClockUtil {
|
||||
public:
|
||||
// ---------------- time in seconds ---------------
|
||||
static time_t NowInSecFast() {
|
||||
return std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
||||
}
|
||||
};
|
||||
|
||||
} // !namespace facebook
|
||||
|
||||
#endif // !COMMON_TIME_TIME_H
|
Loading…
Reference in New Issue
Block a user