DatabaseLogFormatter.GetStopwatch(DbCommandInterceptionContext) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
碼錶過去用來計時處決。 此碼錶從 、 ScalarExecuting(DbCommand, DbCommandInterceptionContext<Object>)和 ReaderExecuting(DbCommand, DbCommandInterceptionContext<DbDataReader>) 方法的結尾開始,並在 、 ScalarExecuted(DbCommand, DbCommandInterceptionContext<Object>)和 ReaderExecuted(DbCommand, DbCommandInterceptionContext<DbDataReader>) 方法 的開頭NonQueryExecuting(DbCommand, DbCommandInterceptionContext<Int32>)NonQueryExecuted(DbCommand, DbCommandInterceptionContext<Int32>)停止。 如果這些方法被覆寫且正在使用碼錶,則覆蓋應該要麼呼叫基礎方法,要麼自行啟動/停止碼錶。
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
參數
- interceptionContext
- DbCommandInterceptionContext
即碼錶將被取得的攔截情境。
傳回
碼錶。