From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9607 invoked by alias); 13 Jul 2016 18:08:24 -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: 21766 Received: (qmail 1434 invoked from network); 13 Jul 2016 18:08:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-pa0-f50.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.220.50):SA:0(0.0/5.0):. Processed in 0.126005 secs); 13 Jul 2016 18:08:24 -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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=VAK8er0uhhlhRooE6DHBTsDTjVhNiJRet+odr7NluKk=; b=IFo4l3T+ms5+akj0BFtSyPgCjikkyquvYltybudhpN8fLddjwiORs/kmra+tTJtvJ0 BB/MIAM5jAMrr4/yeZnMKD+Wm+D+U+0WKBF1d53qudE0gmIDovIwMGPo0G7d5GQRYE26 B/DgGR5IKz5kuc4pPOqCRocqMvaAB+aDGesx34T/LFsfM3FnGQOsggsY+/xLxG2vbEAb gznkt+yW6k8jvHd6ntJlgA4PtABAftzYGnF2riNvuKXnXru6DiHzXspggRePl3xksIQy vkwe4lu1WFrYB+HUIMj/7nQ068/tMCLB6ctAOO1GpMiEyZRxNN5gs8nhJQ/jhbGRNNmy 4pVA== X-Gm-Message-State: ALyK8tKHt0D7VvPqU60wSHiRNYREu0+xgjam/7HA154p0ObVRO0NBPaul9nfKWQWnf9Iyw== X-Received: by 10.66.167.103 with SMTP id zn7mr15568965pab.149.1468433300431; Wed, 13 Jul 2016 11:08:20 -0700 (PDT) From: Bart Schaefer Message-Id: <160713110843.ZM21443@torch.brasslantern.com> Date: Wed, 13 Jul 2016 11:08:43 -0700 In-Reply-To: Comments: In reply to Filipe Silva "profile prompt rendering time" (Jul 13, 11:17am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org, zsh-users@zsh.org Subject: Re: profile prompt rendering time MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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