Home
last modified time | relevance | path

Searched refs:nanos (Results 1 – 25 of 113) sorted by relevance

12345

/third_party/protobuf/src/google/protobuf/util/
Dtime_util.cc60 T CreateNormalized(int64 seconds, int64 nanos);
63 Timestamp CreateNormalized(int64 seconds, int64 nanos) { in CreateNormalized() argument
65 if (nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) { in CreateNormalized()
66 seconds += nanos / kNanosPerSecond; in CreateNormalized()
67 nanos = nanos % kNanosPerSecond; in CreateNormalized()
70 if (nanos < 0) { in CreateNormalized()
72 nanos += kNanosPerSecond; in CreateNormalized()
78 result.set_nanos(static_cast<int32>(nanos)); in CreateNormalized()
83 Duration CreateNormalized(int64 seconds, int64 nanos) { in CreateNormalized() argument
85 if (nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) { in CreateNormalized()
[all …]
Dtime_util.h113 static Duration NanosecondsToDuration(int64 nanos);
135 static Timestamp NanosecondsToTimestamp(int64 nanos);
199 return d1.nanos() < d2.nanos();
213 return d1.seconds() == d2.seconds() && d1.nanos() == d2.nanos();
222 result.set_nanos(-d.nanos());
268 return t1.nanos() < t2.nanos();
282 return t1.seconds() == t2.seconds() && t1.nanos() == t2.nanos();
/third_party/protobuf/python/google/protobuf/internal/
Dwell_known_types.py115 nanos = self.nanos % _NANOS_PER_SECOND
116 total_sec = self.seconds + (self.nanos - nanos) // _NANOS_PER_SECOND
122 if (nanos % 1e9) == 0:
126 if (nanos % 1e6) == 0:
128 return result + '.%03dZ' % (nanos / 1e6)
129 if (nanos % 1e3) == 0:
131 return result + '.%06dZ' % (nanos / 1e3)
133 return result + '.%09dZ' % nanos
175 nanos = round(float('0.' + nano_value) * 1e9)
177 nanos = 0
[all …]
Dwell_known_types_test.py86 message.nanos = 0
88 message.nanos = 10000000
90 message.nanos = 10000
92 message.nanos = 10
96 message.nanos = 0
100 message.nanos = 999999999
110 self.assertEqual(100000000, message.nanos)
114 self.assertEqual(0, message.nanos)
124 message.nanos = 0
126 message.nanos = 10000000
[all …]
/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/
DDurations.java128 public static boolean isValid(long seconds, int nanos) { in isValid() argument
132 if (nanos < -999999999L || nanos >= NANOS_PER_SECOND) { in isValid()
135 if (seconds < 0 || nanos < 0) { in isValid()
136 if (seconds > 0 || nanos > 0) { in isValid()
182 int nanos = duration.getNanos(); in checkValid() local
183 if (!isValid(seconds, nanos)) { in checkValid()
190 seconds, nanos)); in checkValid()
218 int nanos = duration.getNanos(); in toString() local
221 if (seconds < 0 || nanos < 0) { in toString()
224 nanos = -nanos; in toString()
[all …]
DTimestamps.java156 public static boolean isValid(long seconds, int nanos) { in isValid() argument
160 if (nanos < 0 || nanos >= NANOS_PER_SECOND) { in isValid()
170 int nanos = timestamp.getNanos(); in checkValid() local
171 if (!isValid(seconds, nanos)) { in checkValid()
177 seconds, nanos)); in checkValid()
207 int nanos = timestamp.getNanos(); in toString() local
214 if (nanos != 0) { in toString()
216 result.append(formatNanos(nanos)); in toString()
258 int nanos = nanoValue.isEmpty() ? 0 : parseNanos(nanoValue); in parse() local
278 return normalizedTimestamp(seconds, nanos); in parse()
[all …]
DTimeUtil.java335 int nanos = (int) ((result - seconds) * 1000000000); in multiply() local
336 return normalizedDuration(seconds, nanos); in multiply()
379 int nanos = value.remainder(new BigInteger(String.valueOf(NANOS_PER_SECOND))).intValue(); in createDurationFromBigInteger() local
380 return normalizedDuration(seconds, nanos); in createDurationFromBigInteger()
383 private static Duration normalizedDuration(long seconds, int nanos) { in normalizedDuration() argument
384 if (nanos <= -NANOS_PER_SECOND || nanos >= NANOS_PER_SECOND) { in normalizedDuration()
385 seconds += nanos / NANOS_PER_SECOND; in normalizedDuration()
386 nanos %= NANOS_PER_SECOND; in normalizedDuration()
388 if (seconds > 0 && nanos < 0) { in normalizedDuration()
389 nanos += NANOS_PER_SECOND; in normalizedDuration()
[all …]
/third_party/protobuf/src/google/protobuf/stubs/
Dtime.cc133 string FormatNanos(int32 nanos) { in FormatNanos() argument
134 if (nanos % kNanosPerMillisecond == 0) { in FormatNanos()
135 return StringPrintf("%03d", nanos / kNanosPerMillisecond); in FormatNanos()
136 } else if (nanos % kNanosPerMicrosecond == 0) { in FormatNanos()
137 return StringPrintf("%06d", nanos / kNanosPerMicrosecond); in FormatNanos()
139 return StringPrintf("%09d", nanos); in FormatNanos()
170 const char* ParseNanos(const char* data, int32* nanos) { in ParseNanos() argument
189 *nanos = value; in ParseNanos()
264 void GetCurrentTime(int64* seconds, int32* nanos) { in GetCurrentTime() argument
268 *nanos = 0; in GetCurrentTime()
[all …]
Dtime_test.cc234 int32 nanos; in TEST() local
235 ASSERT_TRUE(ParseTime("0001-01-01T00:00:00Z", &seconds, &nanos)); in TEST()
236 EXPECT_EQ("0001-01-01T00:00:00Z", FormatTime(seconds, nanos)); in TEST()
237 ASSERT_TRUE(ParseTime("9999-12-31T23:59:59.999999999Z", &seconds, &nanos)); in TEST()
238 EXPECT_EQ("9999-12-31T23:59:59.999999999Z", FormatTime(seconds, nanos)); in TEST()
241 ASSERT_TRUE(ParseTime("1970-01-01T00:00:00-08:00", &seconds, &nanos)); in TEST()
242 EXPECT_EQ("1970-01-01T08:00:00Z", FormatTime(seconds, nanos)); in TEST()
243 ASSERT_TRUE(ParseTime("1970-01-01T00:00:00+08:00", &seconds, &nanos)); in TEST()
244 EXPECT_EQ("1969-12-31T16:00:00Z", FormatTime(seconds, nanos)); in TEST()
247 ASSERT_TRUE(ParseTime("1970-01-01T00:00:00.01Z", &seconds, &nanos)); in TEST()
[all …]
Dtime.h59 void PROTOBUF_EXPORT GetCurrentTime(int64* seconds, int32* nanos);
68 string PROTOBUF_EXPORT FormatTime(int64 seconds, int32 nanos);
72 int32* nanos);
/third_party/protobuf/objectivec/
DGPBWellKnownTypes.m45 int32_t nanos) {
46 return seconds + (NSTimeInterval)nanos / 1e9;
53 NSTimeInterval nanos = modf(time, &seconds);
55 if (nanosMustBePositive && (nanos < 0)) {
56 // Per Timestamp.proto, nanos is non-negative and "Negative second values with
57 // fractions must still have non-negative nanos values that count forward in
60 nanos = 1.0 + nanos;
63 nanos *= 1e9;
65 return (int32_t)nanos;
101 int32_t nanos = SecondsAndNanosFromTimeInterval(
[all …]
/third_party/node/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/
Dtimestamp.js6 return { seconds: "0", nanos: 0 };
12 nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
18 message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
/third_party/rust/crates/humantime/src/
Ddate.rs163 let mut nanos = 0; in parse_rfc3339_weak() localVariable
177 nanos += mult * (b[idx] - b'0') as u32; in parse_rfc3339_weak()
189 Ok(UNIX_EPOCH + Duration::new(total_seconds, nanos)) in parse_rfc3339_weak()
257 let nanos = dur.subsec_nanos(); in fmt() localVariable
333 let offset = if self.1 == Seconds || nanos == 0 && self.1 == Smart { in fmt()
337 buf[20] = b'0' + (nanos / 100_000_000) as u8; in fmt()
338 buf[21] = b'0' + (nanos / 10_000_000 % 10) as u8; in fmt()
339 buf[22] = b'0' + (nanos / 1_000_000 % 10) as u8; in fmt()
343 buf[20] = b'0' + (nanos / 100_000_000) as u8; in fmt()
344 buf[21] = b'0' + (nanos / 10_000_000 % 10) as u8; in fmt()
[all …]
/third_party/protobuf/src/google/protobuf/
Dduration.proto59 // duration.nanos = end.nanos - start.nanos;
61 // if (duration.seconds < 0 && duration.nanos > 0) {
63 // duration.nanos -= 1000000000;
64 // } else if (duration.seconds > 0 && duration.nanos < 0) {
66 // duration.nanos += 1000000000;
76 // end.nanos = start.nanos + duration.nanos;
78 // if (end.nanos < 0) {
80 // end.nanos += 1000000000;
81 // } else if (end.nanos >= 1000000000) {
83 // end.nanos -= 1000000000;
[all …]
/third_party/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/
DDurationPartial.cs109 int nanos = (int) (ticks % TimeSpan.TicksPerSecond) * NanosecondsPerTick; in FromTimeSpan()
110 return new Duration { Seconds = seconds, Nanos = nanos }; in FromTimeSpan()
249 internal static void AppendNanoseconds(StringBuilder builder, int nanos) in AppendNanoseconds() argument
251 if (nanos != 0) in AppendNanoseconds()
255 if (nanos % 1000000 == 0) in AppendNanoseconds()
257 builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture)); in AppendNanoseconds()
259 else if (nanos % 1000 == 0) in AppendNanoseconds()
261 builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture)); in AppendNanoseconds()
265 builder.Append(nanos.ToString("d9", CultureInfo.InvariantCulture)); in AppendNanoseconds()
/third_party/protobuf/php/src/Google/Protobuf/
DTimestamp.php92 private $nanos = 0; variable in Google\\Protobuf\\Timestamp
157 return $this->nanos;
173 $this->nanos = $var;
186 $this->nanos = 1000 * $datetime->format('u');
196 $time = sprintf('%s.%06d', $this->seconds, $this->nanos / 1000);
DDuration.php80 private $nanos = 0; variable in Google\\Protobuf\\Duration
149 return $this->nanos;
167 $this->nanos = $var;
/third_party/protobuf/objectivec/Tests/
DGPBWellKnownTypesTest.m58 XCTAssertGreaterThanOrEqual(timeStamp.nanos, 0,
60 XCTAssertLessThan(timeStamp.nanos, 1e9,
75 XCTAssertGreaterThanOrEqual(timeStamp.nanos, 0,
77 XCTAssertLessThan(timeStamp.nanos, 1e9,
89 XCTAssertGreaterThanOrEqual(timeStamp.nanos, 0,
91 XCTAssertLessThan(timeStamp.nanos, 1e9,
103 XCTAssertGreaterThanOrEqual(timeStamp.nanos, 0,
105 XCTAssertLessThan(timeStamp.nanos, 1e9,
130 XCTAssertGreaterThanOrEqual(duration.nanos, 0,
135 XCTAssertLessThanOrEqual(duration.nanos, 0,
[all …]
/third_party/protobuf/php/src/Google/Protobuf/Internal/
DGPBUtil.php491 $nanos = bcmul("0" . substr($number, $pos), -1000000000);
493 $nanos = bcmul("0" . substr($number, $pos), 1000000000);
497 $nanos = 0;
501 $duration->setNanos($nanos);
514 $nanos = $value->getNanos();
515 if ($nanos === 0) {
519 if ($nanos % 1000000 === 0) {
521 } elseif ($nanos % 1000 === 0) {
527 $nanos = bcdiv($nanos, '1000000000', $digits);
528 return bcadd($value->getSeconds(), $nanos, $digits);
/third_party/skia/gm/
Danimatedimageblurs.cpp71 bool onAnimate(double nanos) override { in onAnimate() argument
74 fNodes[i].update(nanos, fLastTime); in onAnimate()
78 fLastTime = 1e-9 * nanos; in onAnimate()
108 void update(double nanos, SkScalar lastTime) { in update() argument
109 SkScalar deltaTime = 1e-9 * nanos - lastTime; in update()
122 … fBlur = TimeUtils::PingPong(1e-9 * nanos, kBlurAnimationDuration, fBlurOffset, 0.0f, kBlurMax); in update()
/third_party/skia/tools/timer/
DTimeUtils.h16 static inline SkMSec NanosToMSec(double nanos) { in NanosToMSec() argument
17 const double msec = nanos * 1e-6; in NanosToMSec()
22 static inline double NanosToSeconds(double nanos) { in NanosToSeconds() argument
23 return nanos * 1e-9; in NanosToSeconds()
/third_party/skia/modules/skottie/gm/
DSkottieGM.cpp73 bool onAnimate(double nanos) override { in onAnimate() argument
79 fAnimation->seek(std::fmod(1e-9 * nanos, duration) / duration); in onAnimate()
131 bool onAnimate(double nanos) override { in onAnimate() argument
137 fAnimation->seek(std::fmod(1e-9 * nanos, duration) / duration); in onAnimate()
215 bool onAnimate(double nanos) override { in onAnimate() argument
221 fAnimation->seek(std::fmod(1e-9 * nanos, duration) / duration); in onAnimate()
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-subzero/include/llvm/Support/
DTimeValue.h100 explicit TimeValue (SecondsType seconds, NanoSecondsType nanos = 0)
101 : seconds_( seconds ), nanos_( nanos ) { this->normalize(); } in seconds_()
267 void getTimespecTime( uint64_t& seconds, uint32_t& nanos ) const { in getTimespecTime() argument
269 nanos = nanos_; in getTimespecTime()
296 void nanoseconds ( NanoSecondsType nanos ) { in nanoseconds() argument
297 this->nanos_ = nanos; in nanoseconds()
/third_party/protobuf/src/google/protobuf/util/internal/
Dprotostream_objectsource.cc89 const std::string FormatNanos(uint32 nanos, bool with_trailing_zeros);
339 int32 nanos = p.second; in RenderTimestamp() local
346 if (nanos < 0 || nanos >= kNanosPerSecond) { in RenderTimestamp()
353 ::google::protobuf::internal::FormatTime(seconds, nanos)); in RenderTimestamp()
363 int32 nanos = p.second; in RenderDuration() local
370 if (nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) { in RenderDuration()
378 if (nanos > 0) { in RenderDuration()
387 nanos = -nanos; in RenderDuration()
388 } else if (seconds == 0 && nanos < 0) { in RenderDuration()
390 nanos = -nanos; in RenderDuration()
[all …]
Dprotostream_objectwriter.cc116 StringPiece* nanos) { in SplitSecondsAndNanos() argument
120 *nanos = input.substr(idx + 1); in SplitSecondsAndNanos()
123 *nanos = StringPiece(); in SplitSecondsAndNanos()
130 int32* nanos) { in GetNanosFromStringPiece() argument
131 *nanos = 0; in GetNanosFromStringPiece()
194 *nanos = i_nanos * conversion; in GetNanosFromStringPiece()
1008 int32 nanos; in RenderTimestamp() local
1010 &nanos)) { in RenderTimestamp()
1016 ow->ProtoWriter::RenderDataPiece("nanos", DataPiece(nanos)); in RenderTimestamp()
1073 int32 nanos = 0; in RenderDuration() local
[all …]

12345