<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Tim_the_Timer</id>
	<title>Tim the Timer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Tim_the_Timer"/>
	<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Tim_the_Timer&amp;action=history"/>
	<updated>2026-06-19T13:43:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://charlesreid1.com/w/index.php?title=Tim_the_Timer&amp;diff=18747&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;==Notes==  This page contains Tim the Timer, a little timing object for Java that wraps calls to the system library. It can accumulate time and report the aggregate total, all...&quot;</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Tim_the_Timer&amp;diff=18747&amp;oldid=prev"/>
		<updated>2017-06-25T04:36:11Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Notes==  This page contains Tim the Timer, a little timing object for Java that wraps calls to the system library. It can accumulate time and report the aggregate total, all...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Notes==&lt;br /&gt;
&lt;br /&gt;
This page contains Tim the Timer, a little timing object for Java that wraps calls to the system library. It can accumulate time and report the aggregate total, allowing it to be switched on and off only when operations of interest are being performed.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/** &lt;br /&gt;
 * Tim the timer.&lt;br /&gt;
 *&lt;br /&gt;
 * &amp;quot;Hi Tim!&amp;quot;&lt;br /&gt;
 * &amp;quot;How much Tim - &amp;quot;&lt;br /&gt;
 *&lt;br /&gt;
 * Tim tim = new Tim();&lt;br /&gt;
 * do stuff &lt;br /&gt;
 * tim.elapsedms()&lt;br /&gt;
 */&lt;br /&gt;
public class Tim {&lt;br /&gt;
	double cumulativeTotal, start, end;&lt;br /&gt;
&lt;br /&gt;
    public Tim() {&lt;br /&gt;
		cumulativeTotal = 0.0;&lt;br /&gt;
		start = 0.0; &lt;br /&gt;
		end = 0.0;;&lt;br /&gt;
	}&lt;br /&gt;
	public void tic() {&lt;br /&gt;
        this.start = System.currentTimeMillis();&lt;br /&gt;
	}&lt;br /&gt;
	public void toc() {&lt;br /&gt;
		this.end = System.currentTimeMillis();&lt;br /&gt;
		cumulativeTotal += (end-start);&lt;br /&gt;
	}&lt;br /&gt;
    public double elapsedms() {&lt;br /&gt;
        return cumulativeTotal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flags==&lt;br /&gt;
&lt;br /&gt;
{{CSFlag}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Timing]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>