All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.fix.aggregating.profiler.engine.AdderDrainer Maven / Gradle / Ivy

There is a newer version: 1.6.6
Show newest version
package ru.fix.aggregating.profiler.engine;

import java.util.concurrent.atomic.DoubleAdder;
import java.util.concurrent.atomic.LongAdder;

public class AdderDrainer {
    public static long drain(LongAdder adder) {
        long sum = adder.sum();
        adder.add(-sum);
        return sum;
    }

    public static double drain(DoubleAdder adder) {
        double sum = adder.sum();
        adder.add(-sum);
        return sum;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy