From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23898 invoked by alias); 13 Jul 2016 19:31:46 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21767 Received: (qmail 7578 invoked from network); 13 Jul 2016 19:31:46 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi0-f47.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.218.47):SA:0(0.0/5.0):. Processed in 0.246474 secs); 13 Jul 2016 19:31:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: filipe.silva@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.218.47 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1QbRd1+rrqKDzlHcNWPy39bbdIdrYex4Cshf6Kx2jaA=; b=mBWmIhxFoUvPVOHTNPRyCoeEb2+9UCDYtokHJGTRUEOXtywF6bOtIDs04xwRBU2xhy x/LREOh24GPqBIUASAOgnGj37QJerJbCuuvMSgNy/AVNrS0955joKhsS0T0E4O3Y6Zov DLGUWeyzovp3qwXHCUUcGYqe8FXWMD3sZhl/kxva9rEXKt1lfUUUzdkY3wOAyRiya/ti z0nBAo4/Nn1BddgBVI3hhSTcuml1W+zIEus/GEXLFFW8bKCZB7J88D8oQp0SIJS23IHO TZtcM1Huu7Tgy0nLu4X9CQ4g0srQWArHm35lPTbWzFL3InRZF2vGaPP1UISKjbszsVps MDXw== X-Gm-Message-State: ALyK8tI0kTeoQS1XpjiATvJgV8Nsy4S4Kj4ENqfF4BXGw2jpdkpv+f1J1QKmSbAbHNSP3BAVADCts+vwsAktzA== X-Received: by 10.157.27.103 with SMTP id l94mr6410676otl.54.1468438300635; Wed, 13 Jul 2016 12:31:40 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160713110843.ZM21443@torch.brasslantern.com> References: <160713110843.ZM21443@torch.brasslantern.com> From: Filipe Silva Date: Wed, 13 Jul 2016 16:31:39 -0300 Message-ID: Subject: Re: profile prompt rendering time To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=94eb2c094eec48b79c0537896f1b --94eb2c094eec48b79c0537896f1b Content-Type: text/plain; charset=UTF-8 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 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 > > --94eb2c094eec48b79c0537896f1b--