|
6 | 6 | */
|
7 | 7 | package org.gridsuite.voltageinit.server.service.parameters;
|
8 | 8 |
|
9 |
| -import java.util.*; |
10 |
| -import java.util.concurrent.TimeUnit; |
11 |
| -import java.util.concurrent.atomic.AtomicReference; |
12 |
| - |
13 | 9 | import com.powsybl.iidm.network.Network;
|
14 | 10 | import com.powsybl.iidm.network.VoltageLevel;
|
15 | 11 | import com.powsybl.openreac.parameters.input.OpenReacParameters;
|
|
29 | 25 | import org.springframework.stereotype.Service;
|
30 | 26 | import org.springframework.transaction.annotation.Transactional;
|
31 | 27 |
|
| 28 | +import java.util.*; |
| 29 | +import java.util.concurrent.TimeUnit; |
| 30 | + |
32 | 31 | /**
|
33 | 32 | * @author Ayoub LABIDI <ayoub.labidi at rte-france.com>
|
34 | 33 | */
|
@@ -151,8 +150,7 @@ private void setHighVoltageLimit(List<VoltageLimitOverride> specificVoltageLimit
|
151 | 150 |
|
152 | 151 | @Transactional(readOnly = true)
|
153 | 152 | public OpenReacParameters buildOpenReacParameters(VoltageInitRunContext context, Network network) {
|
154 |
| - AtomicReference<Long> startTime = new AtomicReference<>(); |
155 |
| - startTime.set(System.nanoTime()); |
| 153 | + final long startTime = System.nanoTime(); |
156 | 154 |
|
157 | 155 | Optional<VoltageInitParametersEntity> voltageInitParametersEntity = Optional.empty();
|
158 | 156 | if (context.getParametersUuid() != null) {
|
@@ -192,8 +190,7 @@ public OpenReacParameters buildOpenReacParameters(VoltageInitRunContext context,
|
192 | 190 | //The optimizer will attach reactive slack variables to all buses
|
193 | 191 | parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.ALL);
|
194 | 192 |
|
195 |
| - long nanoTime = System.nanoTime(); |
196 |
| - LOGGER.info("Parameters built in {}s", TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - startTime.getAndSet(nanoTime))); |
| 193 | + LOGGER.info("Parameters built in {}s", TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - startTime)); |
197 | 194 | return parameters;
|
198 | 195 | }
|
199 | 196 |
|
|
0 commit comments