Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!ames!pasteur!ucbvax!decwrl!decvax!ima!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.emacs Subject: Re: updated tools Message-ID: <40509@think.UUCP> Date: 12 May 89 06:34:43 GMT References: <8905111747.AA17268@dsys.icst.nbs.gov> Sender: news@think.UUCP Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge, MA Lines: 26 In article <8905111747.AA17268@dsys.icst.nbs.gov> rbj@dsys.icst.nbs.GOV (Root Boy Jim) writes: >(defun prof (count exp) > "Return the number of seconds required to execute COUNT >iterations of EXP. Don't use this around midnight!" > (let ((beg (time-of-day))) > (while (> count 0) > (eval exp) > (setq count (1- count))) > (- (time-of-day) beg))) Here's a version that works around midnight: (defun prof (count exp) "Return the number seconds required to execute COUNT interations of EXP. It's correct if it takes less than 24 hours." (let ((beg (time-of-day))) (while (> count 0) (eval exp) (setq count (1- count))) (mod (- (time-of-day) beg) (* 24 60 60)))) Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar