Created
September 26, 2015 22:25
-
-
Save WilliamBerryiii/b99e6aceb25f31a380f8 to your computer and use it in GitHub Desktop.
Example of timing a repository method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static DataSet GetSomeStuffFromTheDatabase(int thingId) | |
{ | |
const string PROCEDURE_NAME = "GetMeSomeData"; | |
var parameterLisst = new SqlParameterList(); | |
parameterList.Add("@thing_id", SqlDbType.Int, thingId); | |
var sw = Stopwatch.StartNew(); | |
var results = _sqlExecutioner.ExecuteQuery(_connectionString, PROCEDURE_NAME, parameterList); | |
sw.Stop(); | |
_timeToExecuteGetSomeStuffFromTheDatabase = sw.Elapsed; | |
return results; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment