In SQL Server, you can use the SET STATISTICS TIME statement to display the time it takes to execute a T-SQL statement.
More specifically, it returns the number of milliseconds required to parse, compile, and execute each statement.
When SET STATISTICS TIME is ON, the time statistics for a statement are displayed. When OFF, the time statistics are not displayed.
The setting of SET STATISTICS TIME is set at execute or run time and not at parse time.