/external/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/ |
D | DurationTest.cs | 43 Assert.AreEqual(TimeSpan.FromSeconds(1), new Duration { Seconds = 1 }.ToTimeSpan()); in ToTimeSpan() 44 Assert.AreEqual(TimeSpan.FromSeconds(-1), new Duration { Seconds = -1 }.ToTimeSpan()); in ToTimeSpan() 45 … Assert.AreEqual(TimeSpan.FromMilliseconds(1), new Duration { Nanos = 1000000 }.ToTimeSpan()); in ToTimeSpan() 46 … Assert.AreEqual(TimeSpan.FromMilliseconds(-1), new Duration { Nanos = -1000000 }.ToTimeSpan()); in ToTimeSpan() 47 Assert.AreEqual(TimeSpan.FromTicks(1), new Duration { Nanos = 100 }.ToTimeSpan()); in ToTimeSpan() 48 Assert.AreEqual(TimeSpan.FromTicks(-1), new Duration { Nanos = -100 }.ToTimeSpan()); in ToTimeSpan() 51 Assert.AreEqual(TimeSpan.FromTicks(2), new Duration { Nanos = 250 }.ToTimeSpan()); in ToTimeSpan() 52 Assert.AreEqual(TimeSpan.FromTicks(-2), new Duration { Nanos = -250 }.ToTimeSpan()); in ToTimeSpan() 58 Assert.AreEqual(new Duration { Seconds = 2, Nanos = 100000000 }, in Addition() 59 … new Duration { Seconds = 1, Nanos = 600000000 } + new Duration { Nanos = 500000000 }); in Addition() [all …]
|
D | TimestampTest.cs | 57 … var t1 = new Timestamp { Seconds = 1, Nanos = 1000000 + Duration.NanosecondsPerTick - 1 }; in ToDateTimeTruncation() 60 … var t2 = new Timestamp { Seconds = -1, Nanos = 1000000 + Duration.NanosecondsPerTick - 1 }; in ToDateTimeTruncation() 99 …Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 … in Arithmetic()
|
/external/protobuf/src/google/protobuf/util/ |
D | time_util.h | 52 typedef google::protobuf::Duration Duration; typedef 88 static string ToString(const Duration& duration); 89 static bool FromString(const string& value, Duration* timestamp); 101 static Duration NanosecondsToDuration(int64 nanos); 102 static Duration MicrosecondsToDuration(int64 micros); 103 static Duration MillisecondsToDuration(int64 millis); 104 static Duration SecondsToDuration(int64 seconds); 105 static Duration MinutesToDuration(int64 minutes); 106 static Duration HoursToDuration(int64 hours); 114 static int64 DurationToNanoseconds(const Duration& duration); [all …]
|
D | time_util.cc | 45 using google::protobuf::Duration; 82 Duration CreateNormalized(int64 seconds, int64 nanos) { in CreateNormalized() 98 Duration result; in CreateNormalized() 168 string TimeUtil::ToString(const Duration& duration) { in ToString() 193 bool TimeUtil::FromString(const string& value, Duration* duration) { in FromString() 230 Duration TimeUtil::NanosecondsToDuration(int64 nanos) { in NanosecondsToDuration() 231 return CreateNormalized<Duration>(nanos / kNanosPerSecond, in NanosecondsToDuration() 235 Duration TimeUtil::MicrosecondsToDuration(int64 micros) { in MicrosecondsToDuration() 236 return CreateNormalized<Duration>( in MicrosecondsToDuration() 241 Duration TimeUtil::MillisecondsToDuration(int64 millis) { in MillisecondsToDuration() [all …]
|
/external/protobuf/src/google/protobuf/ |
D | duration.pb.cc | 40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, seconds_), in protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() 41 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, nanos_), in protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() 46 Duration::default_instance_, in protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() 51 sizeof(Duration), in protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() 52 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _internal_metadata_), in protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() 53 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _is_default_instance_)); in protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() 67 Duration_descriptor_, &Duration::default_instance()); in protobuf_RegisterTypes() 73 delete Duration::default_instance_; in protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto() 92 Duration::default_instance_ = new Duration(); in protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto() 93 Duration::default_instance_->InitAsDefaultInstance(); in protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto() [all …]
|
D | duration.pb.h | 40 class Duration; variable 44 class LIBPROTOBUF_EXPORT Duration : public ::google::protobuf::Message { 46 Duration(); 47 virtual ~Duration(); 49 Duration(const Duration& from); 51 inline Duration& operator=(const Duration& from) { 57 static const Duration& default_instance(); 59 void Swap(Duration* other); 63 inline Duration* New() const { return New(NULL); } in New() 65 Duration* New(::google::protobuf::Arena* arena) const; [all …]
|
D | duration.proto | 43 // A Duration represents a signed, fixed-length span of time represented 47 // two Timestamp values is a Duration and it can be added or subtracted 50 // Example 1: Compute Duration from two Timestamps in pseudo code. 54 // Duration duration = ...; 67 // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. 70 // Duration duration = ...; 85 message Duration { message
|
/external/libchrome/base/profiler/ |
D | tracked_time.cc | 15 Duration::Duration() : ms_(0) {} in Duration() function in tracked_objects::Duration 16 Duration::Duration(int32_t duration) : ms_(duration) {} in Duration() function in tracked_objects::Duration 18 Duration& Duration::operator+=(const Duration& other) { in operator +=() 23 Duration Duration::operator+(const Duration& other) const { in operator +() 24 return Duration(ms_ + other.ms_); in operator +() 27 bool Duration::operator==(const Duration& other) const { in operator ==() 31 bool Duration::operator!=(const Duration& other) const { in operator !=() 35 bool Duration::operator>(const Duration& other) const { in operator >() 40 Duration Duration::FromMilliseconds(int ms) { return Duration(ms); } in FromMilliseconds() 42 int32_t Duration::InMilliseconds() const { in InMilliseconds() [all …]
|
D | tracked_time.h | 26 class BASE_EXPORT Duration { // Similar to base::TimeDelta. 28 Duration(); 30 Duration& operator+=(const Duration& other); 31 Duration operator+(const Duration& other) const; 33 bool operator==(const Duration& other) const; 34 bool operator!=(const Duration& other) const; 35 bool operator>(const Duration& other) const; 37 static Duration FromMilliseconds(int ms); 43 explicit Duration(int32_t duration); 55 Duration operator-(const TrackedTime& other) const; [all …]
|
D | tracked_time_unittest.cc | 23 Duration::FromMilliseconds(kSomeMilliseconds); in TEST() 41 Duration first = Duration::FromMilliseconds(kFirstMilliseconds); in TEST() 42 Duration second = Duration::FromMilliseconds(kSecondMilliseconds); in TEST() 47 Duration sum = first + second; in TEST() 66 Duration before = now - TrackedTime(ticks_before); in TEST() 68 Duration after = now - TrackedTime(ticks_after); in TEST() 99 Duration before = now - TrackedTime(ticks_before); in TEST() 101 Duration after = now - TrackedTime(ticks_after); in TEST()
|
/external/protobuf/java/util/src/main/java/com/google/protobuf/util/ |
D | TimeUtil.java | 33 import com.google.protobuf.Duration; 192 public static String toString(Duration duration) in toString() 226 public static Duration parseDuration(String value) throws ParseException { in parseDuration() 270 public static Duration createDurationFromMillis(long milliseconds) { in createDurationFromMillis() 292 public static long toMillis(Duration duration) { in toMillis() 308 public static Duration createDurationFromMicros(long microseconds) { in createDurationFromMicros() 330 public static long toMicros(Duration duration) { in toMicros() 346 public static Duration createDurationFromNanos(long nanoseconds) { in createDurationFromNanos() 361 public static long toNanos(Duration duration) { in toNanos() 382 public static Duration distance(Timestamp from, Timestamp to) { in distance() [all …]
|
/external/libcxx/test/std/utilities/time/time.point/time.point.cons/ |
D | duration.pass.cpp | 24 typedef std::chrono::milliseconds Duration; in main() typedef 26 std::chrono::time_point<Clock, Duration> t(Duration(3)); in main() 27 assert(t.time_since_epoch() == Duration(3)); in main() 30 std::chrono::time_point<Clock, Duration> t(std::chrono::seconds(3)); in main() 31 assert(t.time_since_epoch() == Duration(3000)); in main() 35 constexpr std::chrono::time_point<Clock, Duration> t(Duration(3)); in main() 36 static_assert(t.time_since_epoch() == Duration(3), ""); in main() 39 constexpr std::chrono::time_point<Clock, Duration> t(std::chrono::seconds(3)); in main() 40 static_assert(t.time_since_epoch() == Duration(3000), ""); in main()
|
D | default.pass.cpp | 25 typedef std::chrono::duration<Rep, std::milli> Duration; in main() typedef 27 std::chrono::time_point<Clock, Duration> t; in main() 28 assert(t.time_since_epoch() == Duration::zero()); in main() 32 constexpr std::chrono::time_point<Clock, Duration> t; in main() 33 static_assert(t.time_since_epoch() == Duration::zero(), ""); in main()
|
D | duration.fail.cpp | 23 typedef std::chrono::milliseconds Duration; in main() typedef 24 std::chrono::time_point<Clock, Duration> t = Duration(3); in main()
|
/external/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/ |
D | Duration.cs | 35 …(typeof(global::Google.Protobuf.WellKnownTypes.Duration), global::Google.Protobuf.WellKnownTypes.D… in DurationReflection() 85 public sealed partial class Duration : pb::IMessage<Duration> { class 86 …rivate static readonly pb::MessageParser<Duration> _parser = new pb::MessageParser<Duration>(() =>… 87 public static pb::MessageParser<Duration> Parser { get { return _parser; } } 97 public Duration() { in Duration() method in Google.Protobuf.WellKnownTypes.Duration 103 public Duration(Duration other) : this() { in Duration() method in Google.Protobuf.WellKnownTypes.Duration 108 public Duration Clone() { in Clone() 109 return new Duration(this); in Clone() 145 return Equals(other as Duration); in Equals() 148 public bool Equals(Duration other) { in Equals() [all …]
|
D | DurationPartial.cs | 41 public partial class Duration : ICustomDiagnosticMessage class 103 public static Duration FromTimeSpan(TimeSpan timeSpan) in FromTimeSpan() 110 return new Duration { Seconds = seconds, Nanos = nanos }; in FromTimeSpan() 119 public static Duration operator -(Duration value) in operator -() 134 public static Duration operator +(Duration lhs, Duration rhs) in operator +() 150 public static Duration operator -(Duration lhs, Duration rhs) in operator -() 164 internal static Duration Normalize(long seconds, int nanoseconds) in Normalize() 182 return new Duration { Seconds = seconds, Nanos = nanoseconds }; in Normalize()
|
D | TimestampPartial.cs | 46 internal const int MaxNanos = Duration.NanosecondsPerSecond - 1; 60 public static Duration operator -(Timestamp lhs, Timestamp rhs) in operator -() 66 return Duration.Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); in operator -() 76 public static Timestamp operator +(Timestamp lhs, Duration rhs) in operator +() 92 public static Timestamp operator -(Timestamp lhs, Duration rhs) in operator -() 120 return UnixEpoch.AddSeconds(Seconds).AddTicks(Nanos / Duration.NanosecondsPerTick); in ToDateTime() 154 … int nanoseconds = (int) (dateTime.Ticks % TimeSpan.TicksPerSecond) * Duration.NanosecondsPerTick; in FromDateTime() 175 int extraSeconds = nanoseconds / Duration.NanosecondsPerSecond; in Normalize() 177 nanoseconds -= extraSeconds * Duration.NanosecondsPerSecond; in Normalize() 181 nanoseconds += Duration.NanosecondsPerSecond; in Normalize() [all …]
|
/external/libcxx/test/std/utilities/time/time.point/time.point.arithmetic/ |
D | op_-=.pass.cpp | 22 typedef std::chrono::milliseconds Duration; in main() typedef 23 std::chrono::time_point<Clock, Duration> t(Duration(3)); in main() 24 t -= Duration(2); in main() 25 assert(t.time_since_epoch() == Duration(1)); in main()
|
D | op_+=.pass.cpp | 22 typedef std::chrono::milliseconds Duration; in main() typedef 23 std::chrono::time_point<Clock, Duration> t(Duration(3)); in main() 24 t += Duration(2); in main() 25 assert(t.time_since_epoch() == Duration(5)); in main()
|
/external/protobuf/java/util/src/test/java/com/google/protobuf/util/ |
D | TimeUtilTest.java | 33 import com.google.protobuf.Duration; 245 Duration duration = TimeUtil.distance(start, end); in testDurationStringFormat() 251 duration = Duration.newBuilder().setSeconds(1).build(); in testDurationStringFormat() 253 duration = Duration.newBuilder().setNanos(10000000).build(); in testDurationStringFormat() 255 duration = Duration.newBuilder().setNanos(10000).build(); in testDurationStringFormat() 257 duration = Duration.newBuilder().setNanos(10).build(); in testDurationStringFormat() 282 Duration value = Duration.newBuilder() in testDurationInvalidFormat() 292 Duration value = Duration.newBuilder() in testDurationInvalidFormat() 302 Duration value = Duration.newBuilder().setSeconds(1).setNanos(-1) in testDurationInvalidFormat() 312 Duration value = Duration.newBuilder().setSeconds(-1).setNanos(1) in testDurationInvalidFormat() [all …]
|
/external/icu/android_icu4j/src/main/tests/android/icu/dev/test/duration/ |
D | ICUDurationTest.java | 21 import javax.xml.datatype.Duration; 41 private static final class ICUTestDuration extends javax.xml.datatype.Duration { 96 public Duration add(Duration rhs) { in add() 106 public int compare(Duration duration) { in compare() 131 public Duration multiply(BigDecimal factor) { in multiply() 136 public Duration negate() { in negate() 141 public Duration normalizeWith(java.util.Calendar startTimeInstant) { in normalizeWith() 217 Duration d; in TestSimpleXMLDuration() 277 final Duration duration; in TestXMLDuration() 280 TestCase(String loc, String ds, Duration d, String exp) { in TestXMLDuration() [all …]
|
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/ |
D | ICUDurationTest.java | 20 import javax.xml.datatype.Duration; 40 private static final class ICUTestDuration extends javax.xml.datatype.Duration { 95 public Duration add(Duration rhs) { in add() 105 public int compare(Duration duration) { in compare() 130 public Duration multiply(BigDecimal factor) { in multiply() 135 public Duration negate() { in negate() 140 public Duration normalizeWith(java.util.Calendar startTimeInstant) { in normalizeWith() 216 Duration d; in TestSimpleXMLDuration() 276 final Duration duration; in TestXMLDuration() 279 TestCase(String loc, String ds, Duration d, String exp) { in TestXMLDuration() [all …]
|
/external/libcxx/test/std/utilities/time/time.duration/time.duration.alg/ |
D | abs.pass.cpp | 23 template <class Duration> 25 test(const Duration& f, const Duration& d) in test() 29 static_assert((std::is_same<R, Duration>::value), ""); in test()
|
/external/libcxx/test/std/utilities/time/time.point/time.point.special/ |
D | max.pass.cpp | 22 typedef std::chrono::milliseconds Duration; in main() typedef 23 typedef std::chrono::time_point<Clock, Duration> TP; in main() 24 assert(TP::max() == TP(Duration::max())); in main()
|
D | min.pass.cpp | 22 typedef std::chrono::milliseconds Duration; in main() typedef 23 typedef std::chrono::time_point<Clock, Duration> TP; in main() 24 assert(TP::min() == TP(Duration::min())); in main()
|