Home
last modified time | relevance | path

Searched refs:Nanos (Results 1 – 25 of 27) sorted by relevance

12

/external/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/
DDurationTest.cs45 … 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()
60 Assert.AreEqual(new Duration { Seconds = -2, Nanos = -100000000 }, in Addition()
61 … new Duration { Seconds = -1, Nanos = -600000000 } + new Duration { Nanos = -500000000 }); in Addition()
[all …]
DTimestampTest.cs46 AssertRoundtrip(new Timestamp { Seconds = 253402300799, Nanos = 999999900 }, utcMax); in FromAndToDateTime()
48 …AssertRoundtrip(new Timestamp { Nanos = 1000000}, new DateTime(1970, 1, 1, 0, 0, 0, 1, DateTimeKin… in FromAndToDateTime()
49 …AssertRoundtrip(new Timestamp { Seconds = -1, Nanos = 999000000 }, new DateTime(1969, 12, 31, 23, … in FromAndToDateTime()
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()
71 var value = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in ToDateTime_OutOfRange()
83 var value = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in ToDateTime_ValidBoundaries()
97 Timestamp t1 = new Timestamp { Seconds = 10000, Nanos = 5000 }; in Arithmetic()
98 Timestamp t2 = new Timestamp { Seconds = 8000, Nanos = 10000 }; in Arithmetic()
99 …Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 … in Arithmetic()
[all …]
/external/protobuf/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/
DDurationTest.cs45 … 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()
60 Assert.AreEqual(new Duration { Seconds = -2, Nanos = -100000000 }, in Addition()
61 … new Duration { Seconds = -1, Nanos = -600000000 } + new Duration { Nanos = -500000000 }); in Addition()
[all …]
DTimestampTest.cs46 AssertRoundtrip(new Timestamp { Seconds = 253402300799, Nanos = 999999900 }, utcMax); in FromAndToDateTime()
48 …AssertRoundtrip(new Timestamp { Nanos = 1000000}, new DateTime(1970, 1, 1, 0, 0, 0, 1, DateTimeKin… in FromAndToDateTime()
49 …AssertRoundtrip(new Timestamp { Seconds = -1, Nanos = 999000000 }, new DateTime(1969, 12, 31, 23, … in FromAndToDateTime()
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()
71 var value = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in ToDateTime_OutOfRange()
83 var value = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in ToDateTime_ValidBoundaries()
97 Timestamp t1 = new Timestamp { Seconds = 10000, Nanos = 5000 }; in Arithmetic()
98 Timestamp t2 = new Timestamp { Seconds = 8000, Nanos = 10000 }; in Arithmetic()
99 …Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 … in Arithmetic()
[all …]
/external/golang-protobuf/ptypes/
Dduration_test.go55 {&durpb.Duration{Seconds: 0, Nanos: 0}, true, true, 0},
57 {&durpb.Duration{Seconds: 100, Nanos: 0}, true, true, 100 * time.Second},
58 {&durpb.Duration{Seconds: -100, Nanos: 0}, true, true, -100 * time.Second},
59 {&durpb.Duration{Seconds: 100, Nanos: 987}, true, true, 100*time.Second + 987},
60 {&durpb.Duration{Seconds: -100, Nanos: -987}, true, true, -(100*time.Second + 987)},
62 …{&durpb.Duration{Seconds: maxGoSeconds, Nanos: int32(math.MaxInt64 - 1e9*maxGoSeconds)}, true, tru…
64 …{&durpb.Duration{Seconds: minGoSeconds, Nanos: int32(math.MinInt64 - 1e9*minGoSeconds)}, true, tru…
66 {&durpb.Duration{Seconds: -100, Nanos: 987}, false, false, 0},
67 {&durpb.Duration{Seconds: 100, Nanos: -987}, false, false, 0},
68 {&durpb.Duration{Seconds: math.MinInt64, Nanos: 0}, false, false, 0},
[all …]
Dtimestamp_test.go49 {&tspb.Timestamp{Seconds: 0, Nanos: 0}, true, utcDate(1970, 1, 1)},
51 {&tspb.Timestamp{Seconds: math.MinInt64, Nanos: math.MinInt32}, false,
54 {&tspb.Timestamp{Seconds: math.MinInt64, Nanos: 0}, false, time.Unix(math.MinInt64, 0).UTC()},
56 {&tspb.Timestamp{Seconds: minValidSeconds, Nanos: 0}, true, utcDate(1, 1, 1)},
59 {&tspb.Timestamp{Seconds: math.MaxInt64, Nanos: math.MaxInt32}, false,
62 {&tspb.Timestamp{Seconds: math.MaxInt64, Nanos: 1e9 - 1}, false,
65 {&tspb.Timestamp{Seconds: maxValidSeconds - 1, Nanos: 1e9 - 1}, true,
68 {&tspb.Timestamp{Seconds: maxValidSeconds, Nanos: 0}, false, time.Unix(maxValidSeconds, 0).UTC()},
70 {&tspb.Timestamp{Seconds: -281836800, Nanos: 0}, true, utcDate(1961, 1, 26)},
72 {&tspb.Timestamp{Seconds: 1296000000, Nanos: 0}, true, utcDate(2011, 1, 26)},
[all …]
Dduration.go63 if d.Nanos <= -1e9 || d.Nanos >= 1e9 {
67 if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) {
84 if p.Nanos != 0 {
85 d += time.Duration(p.Nanos) * time.Nanosecond
86 if (d < 0) != (p.Nanos < 0) {
100 Nanos: int32(nanos),
Dtimestamp.go73 if ts.Nanos < 0 || ts.Nanos >= 1e9 {
97 t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC()
116 Nanos: int32(t.Nanosecond()),
/external/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/
DTimestampPartial.cs66 return Duration.Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); in operator -()
82 return Normalize(lhs.Seconds + rhs.Seconds, lhs.Nanos + rhs.Nanos); in operator +()
98 return Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); in operator -()
116 if (!IsNormalized(Seconds, Nanos)) in ToDateTime()
120 return UnixEpoch.AddSeconds(Seconds).AddTicks(Nanos / Duration.NanosecondsPerTick); in ToDateTime()
155 …return new Timestamp { Seconds = secondsSinceBclEpoch - BclSecondsAtUnixEpoch, Nanos = nanoseconds… in FromDateTime()
184 return new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in Normalize()
238 : Nanos < other.Nanos ? -1 in CompareTo()
239 : Nanos > other.Nanos ? 1 in CompareTo()
341 return ToJson(Seconds, Nanos, true); in ToDiagnosticString()
DDuration.cs166 public int Nanos { property in Google.Protobuf.WellKnownTypes.Duration
187 if (Nanos != other.Nanos) return false; in Equals()
195 if (Nanos != 0) hash ^= Nanos.GetHashCode(); in GetHashCode()
213 if (Nanos != 0) { in WriteTo()
215 output.WriteInt32(Nanos); in WriteTo()
228 if (Nanos != 0) { in CalculateSize()
229 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); in CalculateSize()
245 if (other.Nanos != 0) { in MergeFrom()
246 Nanos = other.Nanos; in MergeFrom()
264 Nanos = input.ReadInt32(); in MergeFrom()
DTimestamp.cs187 public int Nanos { property in Google.Protobuf.WellKnownTypes.Timestamp
208 if (Nanos != other.Nanos) return false; in Equals()
216 if (Nanos != 0) hash ^= Nanos.GetHashCode(); in GetHashCode()
234 if (Nanos != 0) { in WriteTo()
236 output.WriteInt32(Nanos); in WriteTo()
249 if (Nanos != 0) { in CalculateSize()
250 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); in CalculateSize()
266 if (other.Nanos != 0) { in MergeFrom()
267 Nanos = other.Nanos; in MergeFrom()
285 Nanos = input.ReadInt32(); in MergeFrom()
DDurationPartial.cs89 if (!IsNormalized(Seconds, Nanos)) in ToTimeSpan()
93 long ticks = Seconds * TimeSpan.TicksPerSecond + Nanos / NanosecondsPerTick; in ToTimeSpan()
110 return new Duration { Seconds = seconds, Nanos = nanos }; in FromTimeSpan()
124 return Normalize(-value.Seconds, -value.Nanos); in operator -()
140 return Normalize(lhs.Seconds + rhs.Seconds, lhs.Nanos + rhs.Nanos); in operator +()
156 return Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); in operator -()
182 return new Duration { Seconds = seconds, Nanos = nanoseconds }; in Normalize()
241 return ToJson(Seconds, Nanos, true); in ToDiagnosticString()
/external/golang-protobuf/jsonpb/
Djsonpb_test.go479 {"Duration with nanos", marshaler, &durpb.Duration{Nanos: 1e6}, `"0.001s"`},
480 {"Duration with -nanos", marshaler, &durpb.Duration{Nanos: -1e6}, `"-0.001s"`},
481 …{"Duration with large secs", marshaler, &durpb.Duration{Seconds: 1e10, Nanos: 1}, `"10000000000.00…
482 {"Duration with 6-digit nanos", marshaler, &durpb.Duration{Nanos: 1e4}, `"0.000010s"`},
483 {"Duration with 3-digit nanos", marshaler, &durpb.Duration{Nanos: 1e6}, `"0.001s"`},
484 …{"Duration with -secs -nanos", marshaler, &durpb.Duration{Seconds: -123, Nanos: -450}, `"-123.0000…
485 …{"Duration max value", marshaler, &durpb.Duration{Seconds: 315576000000, Nanos: 999999999}, `"3155…
486 …{"Duration min value", marshaler, &durpb.Duration{Seconds: -315576000000, Nanos: -999999999}, `"-3…
500 …{"Timestamp", marshaler, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 21e6}}, `{"ts":"…
501 …{"Timestamp", marshaler, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 0}}, `{"ts":"201…
[all …]
/external/golang-protobuf/ptypes/timestamp/
Dtimestamp.pb.go116 Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` member
158 return m.Nanos
/external/golang-protobuf/ptypes/duration/
Dduration.pb.go94 Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` member
136 return m.Nanos
/external/rust/crates/env_logger/src/fmt/humantime/
Dextern_impl.rs73 precision: TimestampPrecision::Nanos, in timestamp_nanos()
113 TimestampPrecision::Nanos => format_rfc3339_nanos, in fmt()
/external/protobuf/csharp/src/Google.Protobuf.Test/
DJsonFormatterTest.cs371 Assert.AreEqual(WrapInQuotes(expected), new Timestamp { Nanos = nanos }.ToString()); in TimestampStandalone()
391 var timestamp = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in TimestampStandalone_NonNormalized()
428 … var json = JsonFormatter.Default.Format(new Duration { Seconds = seconds, Nanos = nanoseconds }); in DurationStandalone()
437 var duration = new Duration { Seconds = seconds, Nanos = nanoseconds }; in DurationStandalone_NonNormalized()
/external/swiftshader/third_party/llvm-10.0/llvm/include/llvm/XRay/
DFDRRecords.h135 uint32_t Nanos = 0; variable
146 Seconds(S), Nanos(N) {} in WallclockRecord()
149 uint32_t nanos() const { return Nanos; } in nanos()
/external/llvm-project/llvm/include/llvm/XRay/
DFDRRecords.h135 uint32_t Nanos = 0; variable
146 Seconds(S), Nanos(N) {} in WallclockRecord()
149 uint32_t nanos() const { return Nanos; } in nanos()
/external/rust/crates/env_logger/src/fmt/
Dmod.rs66 Nanos, enumerator
288 Some(Nanos) => self.buf.timestamp_nanos(), in write_timestamp()
/external/rust/crates/serde/src/de/
Dimpls.rs1864 Nanos, in deserialize() enumerator
1887 "nanos" => Ok(Field::Nanos), in deserialize()
1898 b"nanos" => Ok(Field::Nanos), in deserialize()
1965 Field::Nanos => { in deserialize()
2002 Nanos, in deserialize() enumerator
2025 "nanos_since_epoch" => Ok(Field::Nanos), in deserialize()
2036 b"nanos_since_epoch" => Ok(Field::Nanos), in deserialize()
2105 Field::Nanos => { in deserialize()
/external/protobuf/csharp/src/Google.Protobuf/
DJsonParser.cs847 timestamp += new Duration { Nanos = nanosToAdd, Seconds = secondsToAdd }; in MergeTimestamp()
856 … message.Descriptor.Fields[Timestamp.NanosFieldNumber].Accessor.SetValue(message, timestamp.Nanos); in MergeTimestamp()
/external/rust/crates/env_logger/src/
Dlib.rs631 self.format_timestamp(Some(fmt::TimestampPrecision::Nanos)) in format_timestamp_nanos()
/external/rust/crates/chrono/src/
Ddatetime.rs52 Nanos, enumerator
461 Nanos => Some(Item::Fixed(Fixed::Nanosecond9)), in to_rfc3339_opts()
2340 assert_eq!(dt.to_rfc3339_opts(Nanos, false), "2018-01-11T10:05:13.084660000+08:00"); in test_rfc3339_opts()
2349 assert_eq!(ut.to_rfc3339_opts(Nanos, true), "2018-01-11T02:05:13.084660000Z"); in test_rfc3339_opts()
/external/llvm-project/llvm/lib/XRay/
DRecordInitializer.cpp46 R.Nanos = E.getU32(&OffsetPtr); in visit()

12