An alternative to UBB.threads
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FLocal/MySQLConnector/CommandExecutionLogger.cs

27 lines
574 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Web.Core;
namespace MySQLConnector {
class CommandExecutionLogger : IDisposable {
private readonly ILogger logger;
private readonly DateTime start;
public string commandText;
public CommandExecutionLogger(ILogger logger) {
this.logger = logger;
this.start = DateTime.Now;
}
void IDisposable.Dispose() {
this.logger.Log("Spent " + (DateTime.Now-start).TotalSeconds + " seconds while executing " + this.commandText);
}
}
}