
com.github.tonivade.purecheck.spec.UIOPerfCase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of purecheck Show documentation
Show all versions of purecheck Show documentation
Pure Functional Testing Library
The newest version!
package com.github.tonivade.purecheck.spec;
import com.github.tonivade.purecheck.PerfCase;
import com.github.tonivade.purecheck.PerfCase.Stats;
import com.github.tonivade.purefun.effect.UIO;
import com.github.tonivade.purefun.effect.UIOOf;
import com.github.tonivade.purefun.typeclasses.Instances;
public final class UIOPerfCase {
private final PerfCase, T> perfCase;
public UIOPerfCase(String name, UIO task) {
this.perfCase = new PerfCase<>(name, Instances.monadDefer(), task, UIO.unit());
}
private UIOPerfCase(PerfCase, T> perfCase) {
this.perfCase = perfCase;
}
public UIOPerfCase warmup(int times) {
return new UIOPerfCase<>(perfCase.warmup(times));
}
public UIO run(int times) {
return perfCase.run(times).fix(UIOOf::toUIO);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy