Update AtomicTimeAbsoluteSamples.java and AtomicTimeIncrementalSamples.java
This commit is contained in:
parent
f0f7e609c0
commit
ddfeaade4f
@ -97,7 +97,7 @@ public class AtomicTimeAbsoluteSamples implements AtomicTimeAbsoluteSamplesSnaps
|
||||
|
||||
double samplesCount = Math.min(Math.max(preciseTimeRange / sampleTime, 1d), samples.length);
|
||||
double value = 0;
|
||||
for (int i = 0; i < samplesCount; i++) {
|
||||
for (int i = samplesCount == 1 ? 0 : 1; i < samplesCount; i++) {
|
||||
double sampleValue;
|
||||
if (i == 0) {
|
||||
sampleValue = samples[i] * sampleTime / (double) (currentTime - currentSampleStartTime);
|
||||
|
@ -91,7 +91,7 @@ public class AtomicTimeIncrementalSamples implements AtomicTimeIncrementalSample
|
||||
double samplesCount = Math.min(Math.max(preciseTimeRange / sampleTime, 1d), samples.length);
|
||||
double roundedTimeRange = samplesCount * sampleTime;
|
||||
double value = 0;
|
||||
for (int i = 0; i < samplesCount; i++) {
|
||||
for (int i = samplesCount == 1 ? 0 : 1; i < samplesCount; i++) {
|
||||
double sampleValue;
|
||||
if (i == 0) {
|
||||
sampleValue = samples[i] * sampleTime / (double) (currentTime - currentSampleStartTime);
|
||||
|
Loading…
Reference in New Issue
Block a user