git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Silly Question About Timing

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Feb 9, 2012, 21:10 UTC
Message-ID
<CAE1pOi1+FQNoPZ_P-fmFx-YhnUYzMQT=6zh3s-OyT71vcDm=wQ@mail.gmail.com>
Hi all,

This is a bit silly but I'm trying to time how long it takes to enter a Git controlled directory. I guess this is more of a GNU/Linux question then anything else.

I've noticed that entering a Git controlled project directory takes quite some time so I wanted to measure exactly how much (it's the prompt I'm using that's taking the time, I suspect). I first tried (a bit naive, I admit :-) )

time cd my-project

This doesn't work of course. Obviously, writing a script doesn't work either because then the prompt isn't calculated. Next I tried

date +%H:%M:%S.%N ; cd my-project-abc ; date +%H:%M:%S.%N

but, surprisingly (to me), that doesn't work either. It simply prints the two timestamps and *then* does the cd (or, at least, that's how it seems to behave).

So how would one do this? :-)

Cheers, Hilco

P.S. This slow cd is only the first time, afterwards things have been cached.
Next: Seth Robertson
Message 1 of 4 in “Silly Question About Timing”
  1. Hilco WijbengaFeb 9, 2012
  2. Seth RobertsonFeb 9, 2012
  3. Hilco WijbengaFeb 9, 2012
  4. Frans KlaverFeb 9, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.