module Cryload::Duration

Overview

Parses the duration syntax shared by -d, --timeout, --request-timeout and --warmup. A bare number means seconds, so every v5 invocation keeps working; unit suffixes can be combined (1h30m).

Extended Modules

Defined in:

cryload/duration.cr

Constant Summary

SECONDS_PER_UNIT = {"ms" => 0.001, "s" => 1.0, "m" => 60.0, "h" => 3600.0}
TOKEN = /(\d+(?:\.\d+)?)(ms|s|m|h)/

Instance Method Summary

Instance Method Detail

def format(span : Time::Span) : String #

def parse(raw : String, flag : String) : Time::Span #