Home
last modified time | relevance | path

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

12345678

/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 …]
/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/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/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/grpc/src/core/lib/json/
Djson_util.cc36 int nanos = 0; in ParseDurationFromJson() local
39 nanos = gpr_parse_nonnegative_int(decimal_point + 1); in ParseDurationFromJson()
40 if (nanos == -1) { in ParseDurationFromJson()
48 nanos *= 10; in ParseDurationFromJson()
54 *duration = seconds * GPR_MS_PER_SEC + nanos / GPR_NS_PER_MS; in ParseDurationFromJson()
/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/gstreamer/gstreamer/libs/gst/check/libcheck/libcompat/
Dclock_gettime.c48 uint64_t nanos; in clock_gettime() local
72 nanos = rawTime * sTimebaseInfo.numer / sTimebaseInfo.denom; in clock_gettime()
77 ts->tv_sec = nanos / NANOSECONDS_PER_SECOND; in clock_gettime()
78 ts->tv_nsec = nanos - (ts->tv_sec * NANOSECONDS_PER_SECOND); in clock_gettime()
/third_party/flutter/skia/tools/timer/
DTimeUtils.h15 static inline SkMSec NanosToMSec(double nanos) { in NanosToMSec() argument
16 const double msec = nanos * 1e-6; in NanosToMSec()
21 static inline double NanosToSeconds(double nanos) { in NanosToSeconds() argument
22 return nanos * 1e-9; in NanosToSeconds()
/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/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/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/flutter/skia/gm/
Danimatedimageblurs.cpp70 bool onAnimate(double nanos) override { in onAnimate() argument
73 fNodes[i].update(nanos, fLastTime); in onAnimate()
77 fLastTime = 1e-9 * nanos; in onAnimate()
107 void update(double nanos, SkScalar lastTime) { in update() argument
108 SkScalar deltaTime = 1e-9 * nanos - lastTime; in update()
121 … fBlur = TimeUtils::PingPong(1e-9 * nanos, kBlurAnimationDuration, fBlurOffset, 0.0f, kBlurMax); in update()
/third_party/flutter/skia/modules/skottie/gm/
DSkottieGM.cpp74 bool onAnimate(double nanos) override { in onAnimate() argument
80 fAnimation->seek(std::fmod(1e-9 * nanos, duration) / duration); in onAnimate()
127 bool onAnimate(double nanos) override { in onAnimate() argument
133 fAnimation->seek(std::fmod(1e-9 * nanos, duration) / duration); in onAnimate()
200 bool onAnimate(double nanos) override { in onAnimate() argument
206 fAnimation->seek(std::fmod(1e-9 * nanos, duration) / duration); in onAnimate()
/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/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()

12345678