Introduction

The code for this Windows application is so compact, it is presented here inline. Belying its small size, however, the app actually solves a real-world problem, namely the need to measure events of a few minutes' duration to about a half-second granularity. How long does Photoshop take to launch? How long have I been on the phone? "I'll bring your stapler back in five minutes." Yeah, right. The Radio Shack Deluxe Sports Stopwatch (63-5017) costs $19.99.

Background

This is my entry in the imaginary "smallest useful app" contest--the entire app requires just 16 lines of user code. Thanks to .NET, the exe file is just 12.5k.

The Source Code

As they do in Microsoft Knowledgebase How-To articles, here are the step-by-step instructions:

To use the stopwatch, click inside its window. To stop it, click again. Clicking again will reset the stopwatch to 0 .0 and start it counting again. For fancy effects like lap timing, just launch several copies of the StopWatch app at once.

Points of Interest

There is nothing very interesting here except how an app so simple and small can be surprisingly useful.

History

01/31/04 AD: Initial

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

Share

About the Author

Alastair Dallas is a programmer, systems architect, and information designer with over 20 years experience at companies including Ashton-Tate, Lotus, Netscape, Documentum, and a wide variety of startups. Languages include C#, C, C++, Java, JavaScript, Perl, Python, and VB (in alphabetical order) as well as DHTML, XML, and related technologies. He has written 3 books, 2 on computer topics, and is President of Infospect Press.