/external/protobuf/src/google/protobuf/util/ |
D | time_util.cc | 59 T CreateNormalized(int64 seconds, int64 nanos); 62 Timestamp CreateNormalized(int64 seconds, int64 nanos) { in CreateNormalized() argument 64 if (nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) { in CreateNormalized() 65 seconds += nanos / kNanosPerSecond; in CreateNormalized() 66 nanos = nanos % kNanosPerSecond; in CreateNormalized() 69 if (nanos < 0) { in CreateNormalized() 71 nanos += kNanosPerSecond; in CreateNormalized() 77 result.set_nanos(static_cast<int32>(nanos)); in CreateNormalized() 82 Duration CreateNormalized(int64 seconds, int64 nanos) { in CreateNormalized() argument 84 if (nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) { in CreateNormalized() [all …]
|
D | time_util.h | 101 static Duration NanosecondsToDuration(int64 nanos); 123 static Timestamp NanosecondsToTimestamp(int64 nanos); 183 return d1.nanos() < d2.nanos(); 197 return d1.seconds() == d2.seconds() && d1.nanos() == d2.nanos(); 206 result.set_nanos(-d.nanos()); 250 return t1.nanos() < t2.nanos(); 264 return t1.seconds() == t2.seconds() && t1.nanos() == t2.nanos();
|
/external/protobuf/java/util/src/main/java/com/google/protobuf/util/ |
D | TimeUtil.java | 156 int nanos = nanoValue.isEmpty() ? 0 : parseNanos(nanoValue); in parseTimestamp() local 174 return normalizedTimestamp(seconds, nanos); in parseTimestamp() 200 int nanos = duration.getNanos(); in toString() local 201 if (seconds < 0 || nanos < 0) { in toString() 202 if (seconds > 0 || nanos > 0) { in toString() 209 nanos = -nanos; in toString() 212 if (nanos != 0) { in toString() 214 result.append(formatNanos(nanos)); in toString() 244 int nanos = nanoValue.isEmpty() ? 0 : parseNanos(nanoValue); in parseDuration() local 250 nanos = -nanos; in parseDuration() [all …]
|
/external/protobuf/python/google/protobuf/internal/ |
D | well_known_types.py | 106 nanos = self.nanos % _NANOS_PER_SECOND 107 total_sec = self.seconds + (self.nanos - nanos) // _NANOS_PER_SECOND 113 if (nanos % 1e9) == 0: 117 if (nanos % 1e6) == 0: 119 return result + '.%03dZ' % (nanos / 1e6) 120 if (nanos % 1e3) == 0: 122 return result + '.%06dZ' % (nanos / 1e3) 124 return result + '.%09dZ' % nanos 162 nanos = round(float('0.' + nano_value) * 1e9) 164 nanos = 0 [all …]
|
D | well_known_types_test.py | 78 message.nanos = 0 80 message.nanos = 10000000 82 message.nanos = 10000 84 message.nanos = 10 88 message.nanos = 0 92 message.nanos = 999999999 102 self.assertEqual(100000000, message.nanos) 106 self.assertEqual(0, message.nanos) 112 message.nanos = 0 114 message.nanos = 10000000 [all …]
|
/external/opencensus-java/api/src/main/java/io/opencensus/common/ |
D | Duration.java | 53 public static Duration create(long seconds, int nanos) { in create() argument 62 if (nanos < -MAX_NANOS) { in create() 64 "'nanos' is less than minimum (" + -MAX_NANOS + "): " + nanos); in create() 66 if (nanos > MAX_NANOS) { in create() 68 "'nanos' is greater than maximum (" + MAX_NANOS + "): " + nanos); in create() 70 if ((seconds < 0 && nanos > 0) || (seconds > 0 && nanos < 0)) { in create() 72 "'seconds' and 'nanos' have inconsistent sign: seconds=" + seconds + ", nanos=" + nanos); in create() 74 return new AutoValue_Duration(seconds, nanos); in create() 88 int nanos = (int) (millis % MILLIS_PER_SECOND * NANOS_PER_MILLI); in fromMillis() local 89 return Duration.create(seconds, nanos); in fromMillis()
|
D | Timestamp.java | 57 public static Timestamp create(long seconds, int nanos) { in create() argument 66 if (nanos < 0) { in create() 67 throw new IllegalArgumentException("'nanos' is less than zero: " + nanos); in create() 69 if (nanos > MAX_NANOS) { in create() 71 "'nanos' is greater than maximum (" + MAX_NANOS + "): " + nanos); in create() 73 return new AutoValue_Timestamp(seconds, nanos); in create()
|
/external/slf4j/slf4j-ext/src/main/java/org/slf4j/profiler/ |
D | Util.java | 59 static public double convertToMicros(long nanos) { in convertToMicros() argument 60 return (double) nanos / NANOS_IN_ONE_MICROSECOND; in convertToMicros() 63 static public double convertToMillis(long nanos) { in convertToMillis() argument 64 return (double) nanos / NANOS_IN_ONE_MILLISECOND; in convertToMillis() 67 static public double convertToSeconds(long nanos) { in convertToSeconds() argument 68 return ((double) nanos / NANOS_IN_ONE_SECOND); in convertToSeconds() 76 static String durationInDurationUnitsAsStr(long nanos, DurationUnit durationUnit) { in durationInDurationUnitsAsStr() argument 80 buf.append(nanos); in durationInDurationUnitsAsStr() 83 double micros = convertToMicros(nanos); in durationInDurationUnitsAsStr() 87 double millis = convertToMillis(nanos); in durationInDurationUnitsAsStr() [all …]
|
/external/protobuf/src/google/protobuf/stubs/ |
D | time_test.cc | 181 int32 nanos; in TEST() local 182 ASSERT_TRUE(ParseTime("0001-01-01T00:00:00Z", &seconds, &nanos)); in TEST() 183 EXPECT_EQ("0001-01-01T00:00:00Z", FormatTime(seconds, nanos)); in TEST() 184 ASSERT_TRUE(ParseTime("9999-12-31T23:59:59.999999999Z", &seconds, &nanos)); in TEST() 185 EXPECT_EQ("9999-12-31T23:59:59.999999999Z", FormatTime(seconds, nanos)); in TEST() 188 ASSERT_TRUE(ParseTime("1970-01-01T00:00:00-08:00", &seconds, &nanos)); in TEST() 189 EXPECT_EQ("1970-01-01T08:00:00Z", FormatTime(seconds, nanos)); in TEST() 190 ASSERT_TRUE(ParseTime("1970-01-01T00:00:00+08:00", &seconds, &nanos)); in TEST() 191 EXPECT_EQ("1969-12-31T16:00:00Z", FormatTime(seconds, nanos)); in TEST() 194 ASSERT_TRUE(ParseTime("1970-01-01T00:00:00.01Z", &seconds, &nanos)); in TEST() [all …]
|
D | time.cc | 133 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 …]
|
/external/protobuf/objectivec/ |
D | GPBWellKnownTypes.m | 40 int32_t nanos) { 41 return seconds + (NSTimeInterval)nanos / 1e9; 47 NSTimeInterval nanos = modf(time, &seconds); 48 nanos *= 1e9; 50 return (int32_t)nanos; 62 int32_t nanos = SecondsAndNanosFromTimeIntervalSince1970( 65 self.nanos = nanos; 79 return TimeIntervalSince1970FromSecondsAndNanos(self.seconds, self.nanos); 84 int32_t nanos = 87 self.nanos = nanos; [all …]
|
/external/protobuf/src/google/protobuf/ |
D | duration.proto | 57 // duration.nanos = end.nanos - start.nanos; 59 // if (duration.seconds < 0 && duration.nanos > 0) { 61 // duration.nanos -= 1000000000; 62 // } else if (durations.seconds > 0 && duration.nanos < 0) { 64 // duration.nanos += 1000000000; 74 // end.nanos = start.nanos + duration.nanos; 76 // if (end.nanos < 0) { 78 // end.nanos += 1000000000; 79 // } else if (end.nanos >= 1000000000) { 81 // end.nanos -= 1000000000; [all …]
|
D | duration.pb.cc | 275 if (this->nanos() != 0) { in SerializeWithCachedSizes() 276 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output); in SerializeWithCachedSizes() 291 if (this->nanos() != 0) { in SerializeWithCachedSizesToArray() 292 …target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target); in SerializeWithCachedSizesToArray() 311 if (this->nanos() != 0) { in ByteSize() 314 this->nanos()); in ByteSize() 344 if (from.nanos() != 0) { in MergeFrom() 345 set_nanos(from.nanos()); in MergeFrom() 408 ::google::protobuf::int32 Duration::nanos() const { in nanos() function in google::protobuf::Duration
|
D | timestamp.pb.cc | 289 if (this->nanos() != 0) { in SerializeWithCachedSizes() 290 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output); in SerializeWithCachedSizes() 305 if (this->nanos() != 0) { in SerializeWithCachedSizesToArray() 306 …target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target); in SerializeWithCachedSizesToArray() 325 if (this->nanos() != 0) { in ByteSize() 328 this->nanos()); in ByteSize() 358 if (from.nanos() != 0) { in MergeFrom() 359 set_nanos(from.nanos()); in MergeFrom() 434 ::google::protobuf::int32 Timestamp::nanos() const { in nanos() function in google::protobuf::Timestamp
|
/external/guava/guava/src/com/google/common/base/ |
D | Stopwatch.java | 216 long nanos = elapsedNanos(); in toString() local 218 TimeUnit unit = chooseUnit(nanos); in toString() 219 double value = (double) nanos / NANOSECONDS.convert(1, unit); in toString() 225 private static TimeUnit chooseUnit(long nanos) { in chooseUnit() argument 226 if (DAYS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 229 if (HOURS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 232 if (MINUTES.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 235 if (SECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 238 if (MILLISECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 241 if (MICROSECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit()
|
D | Suppliers.java | 187 long nanos = expirationNanos; in get() local 189 if (nanos == 0 || now - nanos >= 0) { in get() 191 if (nanos == expirationNanos) { // recheck for lost race in get() 194 nanos = now + durationNanos; in get() 197 expirationNanos = (nanos == 0) ? 1 : nanos; in get()
|
/external/golang-protobuf/ptypes/duration/ |
D | duration.proto | 59 // duration.nanos = end.nanos - start.nanos; 61 // if (duration.seconds < 0 && duration.nanos > 0) { 63 // duration.nanos -= 1000000000; 64 // } else if (durations.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 …]
|
/external/syzkaller/vendor/github.com/golang/protobuf/ptypes/duration/ |
D | duration.proto | 59 // duration.nanos = end.nanos - start.nanos; 61 // if (duration.seconds < 0 && duration.nanos > 0) { 63 // duration.nanos -= 1000000000; 64 // } else if (durations.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 …]
|
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/ |
D | ServiceConfigUtil.java | 424 int nanos = nanoValue.isEmpty() ? 0 : parseNanos(nanoValue); 430 nanos = -nanos; 433 return normalizedDuration(seconds, nanos); 462 private static long normalizedDuration(long seconds, int nanos) { 463 if (nanos <= -NANOS_PER_SECOND || nanos >= NANOS_PER_SECOND) { 464 seconds = checkedAdd(seconds, nanos / NANOS_PER_SECOND); 465 nanos %= NANOS_PER_SECOND; 467 if (seconds > 0 && nanos < 0) { 468 nanos += NANOS_PER_SECOND; // no overflow since nanos is negative (and we're adding) 471 if (seconds < 0 && nanos > 0) { [all …]
|
/external/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/ |
D | DurationPartial.cs | 109 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()
|
/external/guava/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/ |
D | Stopwatch.java | 210 private static TimeUnit chooseUnit(long nanos) { in chooseUnit() argument 211 if (DAYS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 214 if (HOURS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 217 if (MINUTES.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 220 if (SECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 223 if (MILLISECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 226 if (MICROSECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit()
|
/external/guava/guava-bootstrap/src/java/util/concurrent/ |
D | AbstractExecutorService.java | 39 boolean timed, long nanos) in doInvokeAny() argument 70 f = ecs.poll(nanos, TimeUnit.NANOSECONDS); in doInvokeAny() 74 nanos -= now - lastTime; in doInvokeAny() 155 long nanos = unit.toNanos(timeout); in invokeAll() local 168 nanos -= now - lastTime; in invokeAll() 170 if (nanos <= 0) in invokeAll() 176 if (nanos <= 0) in invokeAll() 179 f.get(nanos, TimeUnit.NANOSECONDS); in invokeAll() 186 nanos -= now - lastTime; in invokeAll()
|
/external/syzkaller/vendor/github.com/golang/protobuf/ptypes/ |
D | duration.go | 95 nanos := d.Nanoseconds() 96 secs := nanos / 1e9 97 nanos -= secs * 1e9 100 Nanos: int32(nanos),
|
/external/golang-protobuf/ptypes/ |
D | duration.go | 95 nanos := d.Nanoseconds() 96 secs := nanos / 1e9 97 nanos -= secs * 1e9 100 Nanos: int32(nanos),
|
/external/llvm/include/llvm/Support/ |
D | TimeValue.h | 100 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()
|