All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leandro Bucci <guestleandro11@gmail.com>
To: Per Oberg <pero@wolfram.com>, xenomai <xenomai@xenomai.org>
Subject: Re: Execution time
Date: Tue, 16 Feb 2021 15:24:03 +0100	[thread overview]
Message-ID: <CAFZ-hKgyBZzUc0OP_zNiKCsY--3w8MWa15zTrmFiJ_q7QUxRoA@mail.gmail.com> (raw)
In-Reply-To: <2090142485.8963531.1613484202750.JavaMail.zimbra@wolfram.com>

Thanks for the explanation.  Yes, I am using a Raspberry Pi 3, so in a
sense it is normal to have these "small" time differences.  I am running
only one periodic task (1ms period) and execution time between 5 and 10
micro seconds.

Il mar 16 feb 2021, 15:03 Per Oberg <pero@wolfram.com> ha scritto:

>
> ----- Den 16 feb 2021, på kl 12:34, xenomai xenomai@xenomai.org skrev:
>
> > hi, I'm doing some tests. I'm measuring the execution time of a task. the
> > task takes about 10us to complete. But I am noticing that it takes even
> > just over 5us at times. I therefore don't have a constant running time.
> > It's normal? maybe because the precision is of the order of micro
> seconds?
>
> It depends on
>  * The task, and it's priority
>  * How you are measuring time
>  * What hardware you are using
>  * What else is happening in the system
>
> If it's a fairly simple task it shouldn't vary to much, but if the task
> may or may not trigger some extra action. Modern complex CPU's have a lot
> of features that speeds things up for repetitive code. For example, the
> time of reading a memory buffer may depend on what was read before.
>
> If there are other high-priority tasks going on, or perhaps a hardware
> interrupt coming in your tasks execution may be delayed.
>
> Time measurement may differ depending on what functions you use. Some call
> the Linux clock, some use Xenomai based clocks.
>
> Depending on the hardware you may or may not be able to control exactly
> what is happening in your system. This is strictly from memory, but SMI
> interrupts on the PC platform is one such thing that is out of your hands.
> Raspberry Pi is another can of worms if I recall correctly. Firstly, ARM
> has regular interrupts and fast interrupts and I am not sure where Xenomai
> makes the cut. Then there is the broadcom chip of the RPi that I think has
> some handling of the USB that you don't have control over.
>
> Per Öberg
>

  reply	other threads:[~2021-02-16 14:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 11:34 Execution time Leandro Bucci
2021-02-16 14:03 ` Per Oberg
2021-02-16 14:24   ` Leandro Bucci [this message]
2021-03-03 14:45 Leandro Bucci
2021-03-08 10:23 ` Jan Kiszka
2021-03-08 10:35   ` Leandro Bucci

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=CAFZ-hKgyBZzUc0OP_zNiKCsY--3w8MWa15zTrmFiJ_q7QUxRoA@mail.gmail.com \
    --to=guestleandro11@gmail.com \
    --cc=pero@wolfram.com \
    --cc=xenomai@xenomai.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.