[pbs-devel] [PATCH vma-to-pbs 4/9] add support for streaming the VMA file via stdin

Filip Schauer f.schauer at proxmox.com
Tue Apr 9 14:16:33 CEST 2024


On 03/04/2024 16:52, Max Carrara wrote:
>> +    let elapsed_ms = SystemTime::now()
>> +        .duration_since(start_transfer_time)?
>> +        .as_millis();
>> +    println!(
>> +        "Backup finished within {} minutes, {} seconds and {} ms",
>> +        elapsed_ms / 1000000,
>> +        (elapsed_ms / 1000) % 60,
>> +        elapsed_ms % 1000
>> +    );
> The seconds are not calculated correctly here: 1s = 60_000ms
>
> To make it less error prone, you could just use seconds by default and
> milliseconds where necessary, e.g.:
>
>      let total_seconds = duration.as_secs();
>
>      let minutes = total_seconds / 60;
>      let seconds = total_seconds % 60;
>      let milliseconds = duration.as_millis() % 1000;

I don't see what about my seconds calculation is wrong, but I adapted
the code anyway to make it less confusing.





More information about the pbs-devel mailing list