@Override
public void init(Set<ValueSpecification> values, long timeout, TimeUnit ucUnit) {
Instant start = OpenGammaClock.getInstance().instant();
TemporalUnit unit = convertUnit(ucUnit);
Duration remaining = Duration.of(timeout, unit);
_historicalSnapshot1.init(values, timeout, ucUnit);
Instant after1 = OpenGammaClock.getInstance().instant();
Duration duration1 = Duration.between(start, after1);
remaining = remaining.minus(duration1);
if (remaining.isNegative()) {
return;
}
_historicalSnapshot2.init(values, remaining.get(unit), ucUnit);
Instant after2 = OpenGammaClock.getInstance().instant();
Duration duration2 = Duration.between(after1, after2);
remaining = remaining.minus(duration2);
if (remaining.isNegative()) {
return;
}
_baseSnapshot.init(values, remaining.get(unit), ucUnit);