From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Francesc Rocher" Newsgroups: gmane.emacs.devel Subject: Re: uptime.el Date: Tue, 12 Feb 2008 00:03:06 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1202788889 27583 80.91.229.12 (12 Feb 2008 04:01:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Feb 2008 04:01:29 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 12 05:01:52 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JOmL7-0008Sz-9r for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2008 05:01:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOmKe-0003Wc-2G for ged-emacs-devel@m.gmane.org; Mon, 11 Feb 2008 23:01:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOhg5-0000Oj-7s for emacs-devel@gnu.org; Mon, 11 Feb 2008 18:03:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOhg4-0000OW-MS for emacs-devel@gnu.org; Mon, 11 Feb 2008 18:03:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOhg4-0000OT-In for emacs-devel@gnu.org; Mon, 11 Feb 2008 18:03:08 -0500 Original-Received: from rv-out-0910.google.com ([209.85.198.185]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOhg4-0003VF-Ar for emacs-devel@gnu.org; Mon, 11 Feb 2008 18:03:08 -0500 Original-Received: by rv-out-0910.google.com with SMTP id c27so6305813rvf.6 for ; Mon, 11 Feb 2008 15:03:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; bh=GZlnJs52+nDhZ8uzZ0i1VOgsPp7oW8i3QZO6UqfQ70o=; b=XY2iKjHH+CueNdVLwCkRAUQNso/HN9aTvDb4M/TbaamvuXKWg+12mzfDUHzrvoLC3qESvgsCErkpLvr3DDx7hQFD1PtSYycZ26lMsOoKWhhsgPmF7ru8v6KoUHTBS19qHWt91PpUiwVTLT8wxz3725erP7BNy0YFv4vgKp49jHo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=F7TfY9FEM9tYxNObtcviZzt5dOQzlCZAxDAv2X4qU+mtCDnx0NX3eAvsVQ/gj+mjftLBfXoqcvyGesDXjKMFRP1jsPtgbTW7qbIN271q2CEN5XnSBY9Bg69T/F3STxtUuzdO50ytKmDzyOw0z9IOLKj+zpnJv0fGwXWhoBorbM4= Original-Received: by 10.140.144.4 with SMTP id r4mr397429rvd.175.1202770986921; Mon, 11 Feb 2008 15:03:06 -0800 (PST) Original-Received: by 10.141.151.13 with HTTP; Mon, 11 Feb 2008 15:03:06 -0800 (PST) Content-Disposition: inline X-Google-Sender-Auth: 919cbc158f62682d X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-Mailman-Approved-At: Mon, 11 Feb 2008 22:59:52 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:88830 Archived-At: >Glenn Morris wrote: > >Might as well have this functionality. I installed something similar. > >I set emacs-startup-time in command-line. I prefer `emacs-startup-time' defined as a constant, not as a variable. As such, it needs to be evaluated only at startup: (eval-at-startup (defconst emacs-startup-time (current-time) "Time at which GNU Emacs was started up.")) >> (defun emacs-uptime (&optional here) "\ >> Tell how long GNU Emacs has been running. >> If the optional argument HERE is non-nil, insert string at point." > >Didn't see the point of the HERE argument; used an alternative >implementation based on something in gnus-art. The HERE argument is the same as of the function `emacs-version'. >> (defun emacs-startup-time (&optional here format) "\ >> Return string containing the date and time Emacs was started up. > >Didn't see the point of this function, which is basically just a call >to format-time-string. `emacs-uptime' tells you how long emacs has been running, whilst `emacs-startup-time' tells you the time at which Emacs was started up. Regards, --- Francesc Rocher