Share via


DatabaseLogFormatter.GetStopwatch(DbCommandInterceptionContext) Method

Definition

The stopwatch used to time executions. This stopwatch is started at the end of NonQueryExecuting(DbCommand, DbCommandInterceptionContext<Int32>), ScalarExecuting(DbCommand, DbCommandInterceptionContext<Object>), and ReaderExecuting(DbCommand, DbCommandInterceptionContext<DbDataReader>) methods and is stopped at the beginning of the NonQueryExecuted(DbCommand, DbCommandInterceptionContext<Int32>), ScalarExecuted(DbCommand, DbCommandInterceptionContext<Object>), and ReaderExecuted(DbCommand, DbCommandInterceptionContext<DbDataReader>) methods. If these methods are overridden and the stopwatch is being used then the overrides should either call the base method or start/stop the stopwatch themselves.

protected internal System.Diagnostics.Stopwatch GetStopwatch (System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext interceptionContext);
member this.GetStopwatch : System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext -> System.Diagnostics.Stopwatch
Protected Friend Function GetStopwatch (interceptionContext As DbCommandInterceptionContext) As Stopwatch

Parameters

interceptionContext
DbCommandInterceptionContext

The interception context for which the stopwatch will be obtained.

Returns

The stopwatch.

Applies to