Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: profile prompt rendering time
- X-seq: zsh-users 21767
- From: Filipe Silva <filipe.silva@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: profile prompt rendering time
- Date: Wed, 13 Jul 2016 16:31:39 -0300
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1QbRd1+rrqKDzlHcNWPy39bbdIdrYex4Cshf6Kx2jaA=; b=ybAD7lZ0BPkbqfSc/U+mwVpULsN2A+dOTqCzW8WZF5dQytj5KxFvAqZ7U0TfAAUUSA 1jXAABIjyo1dCjpLMaZLcXPvsQS9MMI7Wx9RG5Wxtwj/Z3lmPCj7x9wKFHj2Hy0j1X83 82xBeH5VYHe2n30XQrsVvCEeZsBkrQr/UTihodJ3nUQ1t93f+j5w34m2ghmBk3t0F/xg OGd72WLJsRTsN9GjzAHzETVgI8fdI1YOsKOhAYOsw138SmpfNL3yZVFSGNjL7tYARlun nlAAabt2oB41tjEw+tiAMGFvZJfdCspT136k4zCxwq2Uxw5mOEsWyVk/m9wKWK8/N9BW sAXg==
- In-reply-to: <160713110843.ZM21443@torch.brasslantern.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> <160713110843.ZM21443@torch.brasslantern.com>
Hi, Bart. thanks for the help. I can work with the execution time of ls
included, no problem.
that's because I can compare the execution time of ls in the same dir, with
the plugin, and without the plugin. The difference between the two tests
will give me the performance hit of the plugin.
But I did not really understand where I have to declare SECONDS.See if I
understand correctly. I'll open my zshrc and type this:
```
preexec() {
float SECONDS
}
precmd() {
print $SECONDS
}
```
is that right?
Also, is 4.800e+2 = 480 milliseconds?
thanks again,
Filipe.
On Wed, Jul 13, 2016 at 3:08 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
wrote:
> 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