import * as tsplus_module_1 from "@tsplus/stdlib/data/Duration";
import * as tsplus_module_2 from "@effect/core/io/Schedule/operations/repeatForever";
import * as tsplus_module_3 from "@effect/core/io/Schedule/operations/map";
import * as tsplus_module_4 from "@effect/core/io/Schedule/operations/delayedUsing";
/**
 * A schedule that always recurs, but will wait a certain amount between
 * repetitions, given by `base * factor.pow(n)`, where `n` is the number of
 * repetitions so far. Returns the current duration between recurrences.
 *
 * @tsplus static ets/Schedule/Ops exponential
 */

export function exponential(base, factor = 2.0) {
  return tsplus_module_4.delayedUsing(tsplus_module_3.map_(tsplus_module_2.repeatForever, i => new tsplus_module_1.Duration(base.millis * Math.pow(factor, i))));
}
//# sourceMappingURL=exponential.mjs.map