Running SQL Server 2017, using the interactive REPL client
sqlcmd how do I get the time for Query Execution?
SQL Server Execution Times: CPU time = 1859 ms, elapsed time = 321 ms.
I'm not sure you can.. yet (or at all, ever). However you can use
-Q to get a rough approximation (less the connect/auth/teardown time)
time sqlcmd \ -S localhost \ -U SA \ -P 'mypass' \ -d tempdb \ -Q "SELECT 1 AS 'myQuery';" ----------- 1 (1 rows affected) real 0m0.038s user 0m0.012s sys 0m0.008s