dotnet / dotnet/command-line-api

Question: How to display the elapsed time of any command

Open
#2,096 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

I would like all the commands to display their execution time upon completion or failure.

I figured I could create `System.Diagnostics.Stopwatch` in a singleton that would be initialized in the middleware pipeline but I am not too sure how to add a piece of code that would show the output of the stopwatch at the end of any command.

Any idea on how to achieve this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.