[Mono-list] System.Timers

Miguel de Icaza miguel@ximian.com
06 Nov 2002 01:25:42 -0500


Hello!

> I am tring to write a small egg timer using GTK# and mcs.  What is the
> right way to measure time?  I am assuming that the System.Timer
> namespace
> is specifically for things like this... But it seems that that
> namespace is yet to be implemented.  So, is there any way to measure
> time? Maybe by tapping into the timer class in glib?

You can use System.DateTime.Now, like this:

	DateTime start, end;

	start = DateTime.Now;
	code ();
	end = DateTime.Now;

Miguel