Skip to content

Commit a260bd3

Browse files
Improve 'command took' log line format
1 parent 5675627 commit a260bd3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Globalization;
2+
3+
namespace BenchmarkDotNet.Extensions
4+
{
5+
internal static class DoubleExtensions
6+
{
7+
public static string ToInvariantString(this double value) => value.ToString(CultureInfo.InvariantCulture);
8+
public static string ToInvariantString(this double value, string format) => value.ToString(format, CultureInfo.InvariantCulture);
9+
}
10+
}

src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliCommandExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static DotNetCliCommandResult Execute(DotNetCliCommand parameters)
4646
stopwatch.Stop();
4747
outputReader.StopRead();
4848

49-
parameters.Logger.WriteLineInfo($"// command took {stopwatch.Elapsed.TotalSeconds:0.##}s and exited with {process.ExitCode}");
49+
parameters.Logger.WriteLineInfo($"// command took {stopwatch.Elapsed.TotalSeconds.ToInvariantString("0.##")} sec and exited with {process.ExitCode}");
5050

5151
return process.ExitCode <= 0
5252
? DotNetCliCommandResult.Success(stopwatch.Elapsed, outputReader.GetOutputText())

0 commit comments

Comments
 (0)