public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Max Carrara" <m.carrara@proxmox.com>
To: "Proxmox Backup Server development discussion"
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH vma-to-pbs 4/9] add support for streaming the VMA file via stdin
Date: Tue, 09 Apr 2024 15:06:10 +0200	[thread overview]
Message-ID: <D0FM4JYBU7TS.2A60D2MGBVG6H@proxmox.com> (raw)
In-Reply-To: <3e418de5-0919-4e6c-905b-79e6bb1c2dbb@proxmox.com>

On Tue Apr 9, 2024 at 2:16 PM CEST, Filip Schauer wrote:
> 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.

My bad! I phrased that incorrectly; I meant that 1 minute = 60_000ms.
Sorry for the confusion!

>
>
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel





  reply	other threads:[~2024-04-09 13:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03  9:49 [pbs-devel] [PATCH vma-to-pbs 0/9] Implement vma-to-pbs tool Filip Schauer
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 1/9] Add the ability to provide credentials via files Filip Schauer
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 2/9] bump proxmox-backup-qemu Filip Schauer
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 3/9] remove unnecessary "extern crate" declarations Filip Schauer
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 4/9] add support for streaming the VMA file via stdin Filip Schauer
2024-04-03 14:52   ` Max Carrara
2024-04-09 12:16     ` Filip Schauer
2024-04-09 13:06       ` Max Carrara [this message]
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 5/9] add a fallback for the --fingerprint argument Filip Schauer
2024-04-03 14:52   ` Max Carrara
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 6/9] refactor error handling Filip Schauer
2024-04-03 14:52   ` Max Carrara
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 7/9] makefile: remove reference to unused submodule Filip Schauer
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 8/9] switch argument handling from clap to pico-args Filip Schauer
2024-04-03 14:52   ` Max Carrara
2024-04-09 12:16     ` Filip Schauer
2024-04-03  9:49 ` [pbs-devel] [PATCH vma-to-pbs 9/9] reformat command line arguments to kebab-case Filip Schauer
2024-04-03  9:57 ` [pbs-devel] [PATCH vma-to-pbs 0/9] Implement vma-to-pbs tool Filip Schauer
2024-04-03 14:51 ` Max Carrara
2024-04-09 12:17   ` Filip Schauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D0FM4JYBU7TS.2A60D2MGBVG6H@proxmox.com \
    --to=m.carrara@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal