<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Microsoft Theme 2.00" content="Arctic 011">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Georgia;
        panose-1:2 4 5 2 5 4 5 2 3 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Verdana","sans-serif";
        color:black;}
h1
        {mso-style-priority:9;
        mso-style-link:"Heading 1 Char";
        margin-top:24.0pt;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:0in;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:16.0pt;
        font-family:"Verdana","sans-serif";
        color:black;}
h2
        {mso-style-priority:9;
        mso-style-link:"Heading 2 Char";
        margin-top:10.0pt;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:0in;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:14.0pt;
        font-family:"Verdana","sans-serif";
        color:black;
        font-weight:normal;}
h3
        {mso-style-priority:9;
        mso-style-link:"Heading 3 Char";
        margin-top:10.0pt;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:0in;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:13.0pt;
        font-family:"Verdana","sans-serif";
        color:black;
        font-weight:normal;}
h4
        {mso-style-priority:9;
        mso-style-link:"Heading 4 Char";
        margin-top:10.0pt;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:0in;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:14.0pt;
        font-family:"Verdana","sans-serif";
        color:black;
        font-weight:normal;}
h5
        {mso-style-priority:9;
        mso-style-link:"Heading 5 Char";
        margin-top:10.0pt;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:0in;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:13.0pt;
        font-family:"Verdana","sans-serif";
        color:black;
        font-weight:normal;}
h6
        {mso-style-priority:9;
        mso-style-link:"Heading 6 Char";
        margin-top:10.0pt;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:0in;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:11.0pt;
        font-family:"Verdana","sans-serif";
        color:black;
        font-weight:normal;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#9D454F;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#814E95;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        color:black;}
span.Heading1Char
        {mso-style-name:"Heading 1 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 1";
        font-family:"Verdana","sans-serif";
        color:black;
        font-weight:bold;}
span.Heading2Char
        {mso-style-name:"Heading 2 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 2";
        font-family:"Verdana","sans-serif";
        color:black;}
span.Heading3Char
        {mso-style-name:"Heading 3 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 3";
        font-family:"Verdana","sans-serif";
        color:black;}
span.Heading4Char
        {mso-style-name:"Heading 4 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 4";
        font-family:"Verdana","sans-serif";
        color:black;}
span.Heading5Char
        {mso-style-name:"Heading 5 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 5";
        font-family:"Verdana","sans-serif";
        color:black;}
span.Heading6Char
        {mso-style-name:"Heading 6 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 6";
        font-family:"Verdana","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" background="cid:image001.gif@01CFD0EA.E54C9600" lang="EN-US" link="#9D454F" vlink="#814E95">
<img src="cid:image001.gif@01CFD0EA.E54C9600" v:src="cid:image001.gif@01CFD0EA.E54C9600" v:shapes="_x0000_Mail" width="0" height="0" class="shape" style="display:none;width:0;height:0"><!--[if gte mso 9]><xml>
<v:background id="_x0000_s1025" o:bwmode="white" o:targetscreensize="1024,768">
<v:fill src="cid:image001.gif@01CFD0EA.E54C9600" o:title="background_arctic" type="frame" />
</v:background></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">All,<o:p></o:p></p>
<p class="MsoNormal">I am sure this question has been answered before, but I can’t find it.<o:p></o:p></p>
<p class="MsoNormal">Suppose I want to call some function, either built-in or user-defined, n number of times, and measure the total time it takes. Is there a more efficient or elegant way
<o:p></o:p></p>
<p class="MsoNormal">of doing this than passing the expression to a tail-recursive counting loop such as the following?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">(define (repeater sexpr count)<o:p></o:p></p>
<p class="MsoNormal">  (sexpr)<o:p></o:p></p>
<p class="MsoNormal">  (cond <o:p></o:p></p>
<p class="MsoNormal">    [(> count 0) (repeater sexpr (- count 1)) ])<o:p></o:p></p>
<p class="MsoNormal">)  <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Georgia","serif"">George Rudolph<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Georgia","serif"">Associate Professor of Computer Science<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Georgia","serif"">Department of Mathematics and Computer Science<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Georgia","serif"">225 Thompson Hall<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Georgia","serif"">The Citadel<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Georgia","serif"">171 Moultrie Street<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Georgia","serif"">Charleston, SC 29409<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Georgia","serif"">843.953.5032<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>