Hi, I am trying to create a global class that I can use in my projects, I intend to use it as the default template, I am new, so please be patient;)
Stopwatch Masterstopwatch = new Stopwatch();
#if DEBUG
private static void ApplicationLogStart()
{
StartTime = DateTime.Now;
Masterstopwatch.Start();
String eventName = "Program Loaded";
String errorDetails = "Program has started Succesfully";
DataLogEntry(eventName, errorDetails);
}
private static void ApplicationLogclosing()
{
String eventName = "Program is closing";
String errorDetails = "Program has closed Succesfully";
DataLogEntry(eventName, errorDetails);
StopTime = DateTime.Now;
Masterstopwatch.Stop();
Benchmark(StartTime,StopTime,Masterstopwatch.Elapsed);
}
#endif
I suspect that I am mistaken in my design because I need a stopwatch Masterstopwatch = new stopwatch (); to be declared globally without using the method, I suspect that this is not possible, but I need to ask Thanks
source
share