Bee Eee Blog

Archive for June, 2008

c# timing functions

by brian on Jun.12, 2008, under .NET, c#, coding

Here are some timing functions that come in the .Net framework.  I’ve used these for moderately accurate timing code — at least down to the millisecond level.  For any timing less than about 30 milliseconds these work much better than timer events piled on each other which tend to get inaccurate.

int begin = System.Environment.TickCount
... do something
int end = System.Environment.TickCount
int elapsed = end - begin;
Leave a Comment :, , more...

c# getting a list of files from a directory

by brian on Jun.04, 2008, under .NET, c#, coding

Here’s how to get an array of file descriptors (name and other information).

System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(Program.DataDirectory);
System.IO.FileInfo[] files = di.GetFiles("*.txt");
Leave a Comment :, , more...

c# getting the application directory.

by brian on Jun.04, 2008, under .NET, c#, coding

Getting the directory that the application is in at run-time is nice.  Here’s the code.

string appDir = AppDomain.CurrentDomain.BaseDirectory;
Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...