From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.help Subject: Re: How to count the number of occurrences of a character in a string? Date: Wed, 14 Oct 2015 18:19:21 +0000 (UTC) Message-ID: References: <874mhvq3b2.fsf@mbork.pl> <8337xezpdc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1444850911 25812 80.91.229.3 (14 Oct 2015 19:28:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Oct 2015 19:28:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 14 21:28:26 2015 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 1ZmRir-00085c-Ke for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Oct 2015 21:28:25 +0200 Original-Received: from localhost ([::1]:44123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmRir-0008LW-1F for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Oct 2015 15:28:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmQeE-0006vR-VA for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 14:19:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmQeA-0001uB-Nz for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 14:19:34 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmQeA-0001ty-FK for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 14:19:30 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZmQe7-00064g-TF for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 20:19:28 +0200 Original-Received: from 66-207-217-202.beanfield.net ([66-207-217-202.beanfield.net]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Oct 2015 20:19:27 +0200 Original-Received: from npostavs by 66-207-217-202.beanfield.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Oct 2015 20:19:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 10 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 66.207.217.202 (Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:107643 Archived-At: Kaushal Modi gmail.com> writes: > I ran the below wrapper progn block couple of times and I got > different results each time. Oddly enough, I even got negative > execution times. > What am I doing wrong? `benchmark' is a function, you need to quote the code you pass to it, otherwise you're measuring how long it takes to evaluate `2' (the result of the progn block).