From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Making sure I'm not checking email (or doing other things) too often Date: Sun, 06 Mar 2016 14:39:46 +0100 Message-ID: <87wppf7mjh.fsf@web.de> References: <87d1rz2ebl.fsf@mbork.pl> <87h9hayr31.fsf@web.de> <87k2lfzqi0.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1457271630 20482 80.91.229.3 (6 Mar 2016 13:40:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2016 13:40:30 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 06 14:40:19 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1acYuv-0000yF-2l for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Mar 2016 14:40:17 +0100 Original-Received: from localhost ([::1]:50533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acYup-0007kF-Fp for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Mar 2016 08:40:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acYud-0007jp-Iu for help-gnu-emacs@gnu.org; Sun, 06 Mar 2016 08:40:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acYua-0001Rz-D6 for help-gnu-emacs@gnu.org; Sun, 06 Mar 2016 08:39:59 -0500 Original-Received: from mout.web.de ([212.227.15.4]:60499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acYua-0001Ru-3u for help-gnu-emacs@gnu.org; Sun, 06 Mar 2016 08:39:56 -0500 Original-Received: from drachen.dragon ([92.74.189.174]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0MGRMG-1aguUW0BGa-00DEho; Sun, 06 Mar 2016 14:39:48 +0100 In-Reply-To: <87k2lfzqi0.fsf@mbork.pl> (Marcin Borkowski's message of "Sun, 06 Mar 2016 14:26:47 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) X-Provags-ID: V03:K0:ClvV2Y0vOIHUnh49RqYMF+C7w864dNNkMc+5gw7PADN1X3SDyRX 7jFRNNIXK+Y/p5kLh+HE839Fvk9D0orb7DI0bA6bcTlwMIvOHdf9SeO0WZI+tivAIk352uU PorWKihaGbpIjW87cTtEU5TK7SlCaJ+0iWC6E3sulFk0o44zQIjTyfxILp9YgnwAkKlsh2x hXQg+4SCFRWTmlJNvOz7Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:ORUoxNyBYko=:SoN1V4XZmJEPUj3qPy2qa0 2GKoSeOYEag39Zh0fhDdDQUMZShmP4qHAcV9OL0dFKjPdtm8jMU6ocoWqXfCj0/MVpAT3pvqd PoKbc8YY+D0f9n4PHpvA+pE2v1yssJ9sB3t9Zu/iGjvr3FujO2BCmrRyWNJThkHaSwDPZG4Yz rjf/7nsaa4UPldQMwyNuKcNXqe8/Ctu4wBwCVKALg+ZZI2LALNK0efTzSXk1oSrwx2saS36QM V5aTHUcrNw0tTgTXLY9ZDX+h/sy9SPbLKvvLQk3foTa30Pn15KNQ61aeb9HqzWOiewUFP0YD+ lhs2jFkCTE5LuFpA46N1pwYFs0/4INuuebaQzApXg0tH2P1FyIvGyzOjy5u49v1AK5X4vms9t oMI/9yilDaHqDvEkj9maWaPSgXHPXHO4aefr0dJRfrHFekXxcfTk24CmtydCVU6z5PPYjQt+Z s2OXb35PPYgLtCdZG/N56RifxQPg109cjhi6iRjsF2BRZS/uc2MTPjIq7zgYindLVW+K3o/Es PHv061vYG1a4HiQr7crLjTMt6rl4oIINnupaj4AleqQpNV8lNwWdFq80/0lmzwVPB+gSmBCGx BSjWuj7Uxrmv9+tO3nOdOGENE6Px4ibqco959q/bt5rzqCBnCWtxT49S0Ggl4hxS+j3JV07jG 1OOdPMfK+M7FWAu8wqxuXNFDFpH5L5Mk3iJChJnJ7wIvmrJH0PTpjRj+/58g4nEgOR8ZKpPXc TAhC9yUbn87gDrV0Mb2USk1xKR3kwxJEBnoCNTy7tKDfZl5blg5xd6XDwnxHJcJWHAcQsOYi X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.4 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109470 Archived-At: Marcin Borkowski writes: > (defun create-stopwatch () > "Return a closure which returns time (in seconds) since its > last invocation every time it is called." > (let (last-invocation-time (current-time)) > (lambda () > (prog1 > (time-to-seconds (time-subtract (current-time) last-invocation-time)) > (setq last-invocation-time (current-time)))))) > > I don't claim it to be better, but I noticed a strange phenomenon. When > I invoke the "stopwatch object" (closure, in fact) for the first time, > I get negative result. Why is that so? Eehm, eh...looks like your let bindings are not what you intended... Ask the byte compiler! Regards, Michael.