14 #ifndef OR_TOOLS_BASE_PROTOUTIL_H_
15 #define OR_TOOLS_BASE_PROTOUTIL_H_
17 #include "absl/status/status.h"
18 #include "absl/status/statusor.h"
19 #include "absl/time/clock.h"
20 #include "absl/time/time.h"
21 #include "google/protobuf/duration.pb.h"
27 google::protobuf::Duration
proto;
28 const int64 d_in_nano = ToInt64Nanoseconds(d);
29 proto.set_seconds(
static_cast<int64>(d_in_nano / 1000000000));
30 proto.set_nanos(
static_cast<int>(d_in_nano % 1000000000));
35 google::protobuf::Duration*
proto) {
37 return absl::OkStatus();
41 const google::protobuf::Duration&
proto) {
42 return absl::Seconds(
proto.seconds() + 1e-9 *
proto.nanos());
47 #endif // OR_TOOLS_BASE_PROTOUTIL_H_