Formats a byte size into a human readable string with appropriate units (B, KB, MB, GB)
The function will add decimal points for values between units (e.g., 1.5KB)
Formats a duration in milliseconds into a human readable string
For durations < 1000ms, formats as milliseconds
For durations >= 1000ms, formats as seconds with up to one decimal place
Calculates latency between a previous timestamp and now
If previous timestamp is None, returns current timestamp
Returns: Some(latency in milliseconds) or Some(current timestamp) if input is None
Resolves a path string to its absolute form.
If the path starts with ‘~’, it will be expanded to the user’s home directory.
Returns an empty string if the input path is empty.