Serializes this instance to a versioned format. Instance method that converts the current state to a storable/transportable form. Must include a version field for deserialization to know how to reconstruct.
Serialized representation with version field
StaticdeserializeStaticfromStaticfromStaticfromStaticfromStaticfromStaticfromStaticfromCreate a TimeSpan from string
// Will be 5000 milliseconds.
TimeSpan.fromStr("5s").toMilliseconds()
Under the hood, this method leverages @lukeed/ms package to convert various time formats into milliseconds. Refer to its documentation for a complete list of supported time formats and units.
Staticfrom
The
TimeSpanclass is used for representing time interval.TimeSpanclass cannot be negative, if you pass negative number it will be converted to 0.IMPORT_PATH:
"@daiso-tech/core/time-span"