From: Marek Vasut Date: Wed, 16 Oct 2019 18:44:25 +0200 Subject: [U-Boot] [PATCH] lib: time: Add microsecond timer In-Reply-To: References: <20191015204341.23613-1-marek.vasut+renesas@gmail.com> <95720451-7b2e-5925-7e9b-78c7eaa515dd@gmail.com> Message-ID: <1751086f-8f4d-8622-6a71-1004f97d2ee7@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/16/19 6:40 PM, Simon Glass wrote: > Hi Marek, Hi, > On Wed, 16 Oct 2019 at 02:55, Marek Vasut wrote: >> >> On 10/16/19 3:30 AM, Simon Glass wrote: >>> Hi Marek, >> >> Hi, >> >>> On Tue, 15 Oct 2019 at 14:43, Marek Vasut wrote: >>>> >>>> Add get_timer_us(), which is useful e.g. when we need higher >>>> precision timestamps. >>> >>> Can we use timer_get_us()? It seems confusing to have two. >> >> Nope, that one doesn't have the range (unsigned long vs. u64) and also >> doesn't behave the same way as old get_timer(). I wanted something which >> is similar, just for uS instead of mS. > > Can you add comments to your patch to indicate what is going on any > why to use this? > > Bootstage uses ulong which is enough for about an hour. How long is > U-Boot running? It can run as long as anyone needs. > If you are using differential times, presumably for timeouts, then > there seems to be little reason to need u64. I use it for logging timestamps during profiling, e.g. of the EHCI driver. -- Best regards, Marek Vasut