.Net

Code Snippet - The Stopwatch Class as a Tool

There are some really cool tools available to help you test and improve your programs in the.Net Framework.

One of the most simple is the Stopwatch class, situated in the System.Diagnostics namespace. As the name suggests it allows you to create a stopwatch object, and use it to time processes, operations or any other part of your program.

Code Snippet - Printing a Binary Triangle

This little code snippet comes directly from a 'code challenge' I completed on Programr.com and I found it really interesting so decided to put it up here.

The challenge was to create a binary triangle of a size determined by the user. So the program collected user input for the number of rows and then printed a binary triangle to the console output in the format given in the challenge spec below. The method shown here does not include gathering the user input.

Code Snippets - Overview

This is the home page for the code snippets; pieces of code that I've written that I have found interesting, useful or both.

Pages