Documentation

Std.Internal.Async.Timer

Sleep can be used to sleep for some duration once. The underlying timer has millisecond resolution.

Instances For
    @[inline]

    Set up a Sleep that waits for duration milliseconds. This function only initializes but does not yet start the timer.

    Equations
    Instances For
      @[inline]

      If:

      • s is not yet running start it and return an AsyncTask that will resolve once the previously configured duration has run out.
      • s is already or not anymore running return the same AsyncTask as the first call to wait.
      Equations
      Instances For
        @[inline]

        If:

        • s is still running the timer restarts counting from now and finishes after duration milliseconds.
        • s is not yet or not anymore running this is a no-op.
        Equations
        Instances For
          @[inline]

          If:

          • s is still running this stops s without resolving any remaining AsyncTasks that were created through wait. Note that if another AsyncTask is binding on any of these it is going hang forever without further intervention.
          • s is not yet or not anymore running this is a no-op.
          Equations
          Instances For

            Create a Selector that resolves once s has finished. Note that calling this function starts s if it hasn't already started.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Return an AsyncTask that resolves after duration.

              Equations
              Instances For

                Return a Selector that resolves after duration.

                Equations
                Instances For

                  Interval can be used to repeatedly wait for some duration like a clock. The underlying timer has millisecond resolution.

                  Instances For
                    @[inline]

                    Setup up an Interval that waits for duration milliseconds. This function only initializes but does not yet start the timer.

                    Equations
                    Instances For
                      @[inline]

                      If:

                      • i is not yet running start it and return an AsyncTask that resolves right away as the 0th multiple of duration has elapsed.
                      • i is already running and:
                        • the tick from the last call of i has not yet finished return the same AsyncTask as the last call
                        • the tick from the last call of i has finished return a new AsyncTask that waits for the closest next tick from the time of calling this function.
                      • i is not running anymore this is a no-op.
                      Equations
                      Instances For
                        @[inline]

                        If:

                        • Interval.tick was called on i before the timer restarts counting from now and the next tick happens in duration.
                        • i is not yet or not anymore running this is a no-op.
                        Equations
                        Instances For
                          @[inline]

                          If:

                          • i is still running this stops i without resolving any remaining AsyncTask that were created through tick. Note that if another AsyncTask is binding on any of these it is going hang forever without further intervention.
                          • i is not yet or not anymore running this is a no-op.
                          Equations
                          Instances For