Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: profile prompt rendering time
- X-seq: zsh-users 21766
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx, zsh-users@xxxxxxx
- Subject: Re: profile prompt rendering time
- Date: Wed, 13 Jul 2016 11:08:43 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=VAK8er0uhhlhRooE6DHBTsDTjVhNiJRet+odr7NluKk=; b=J+nMu5qgIdL/aZ/wPDBVMMSZLVY98NW7VGEsT/vT0VLm1xrMHBVhD09UB4t9hs+GxQ hPk2HbcmtFEfLIJ2Klx0cyFPAkM026vEEhgX9mP8SEilVIaaZFhbSwfr3416w5CnEZht JsYEEuj48Q/dTzmDV10pKXEWNfcYhC8jxJ3o5/5ciyVOaZ+g5g4SSUDiEdznfmmcdHCb qEeaY/oP0zOJhL9RPDucV2qDX9Sjb0sw0AD9CKfRXn1GAIpAx5+nFSjHCPXnUtAj0Cp/ iaQC7Vue/DeH5LXIiccDJQzFjYmVtFQApX8fkw24ThQYpSyl2GWHAqZQVTlTMQwHM/wa qB4Q==
- In-reply-to: <CAEwkUWO7yrxptZChw7Q3F=u=0+Uwf+Frmzo24py3xvrK1=cTtA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAEwkUWO7yrxptZChw7Q3F=u=0+Uwf+Frmzo24py3xvrK1=cTtA@mail.gmail.com>
On Jul 13, 11:17am, Filipe Silva wrote:
}
} I'm talking about the time that it takes for zsh to give me another
} prompt once that it is fully loaded. In other words, I want to achieve
} this:
}
} ~ $ ls (when i hit enter, start counting)
} code/ notes/ file.txt
} ~ $ (stop counting when this prompt appears. show me elapsed time)
By your literal example, you would be getting a timing that includes
the execution of "ls". Is that really what you want?
Assuming not, probably the closest you can get is to declare
float SECONDS
and then print $SECONDS at the end of your precmd function, and at the
beginning of the zle-line-init widget call "zle -M $SECONDS".
However, I don't know how to explain in detail how to accomplish that
because you mention using plugins and I have no way to know whether
those plugins have co-opted precmd or zle-line-init for other uses.
If you really do want to include the execution time of "ls", then
print $SECONDS at the end of preexec instead of at the end of precmd.
Just to demonstrate, here's the output from precmd/zle-line-init with
an otherwise virgin "zsh -f" on my desktop:
torch% echo start
start
4.800639270e+02
torch%
4.800641060e+02
Messages sorted by:
Reverse Date,
Date,
Thread,
Author