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

com.github.tonivade.purecheck.spec.UIOPerfCase Maven / Gradle / Ivy

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