Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 26eb583

Browse files
committed
Show operation time in ms
1 parent 91171db commit 26eb583

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

UniqueFileGenerator/Program.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ public static void Main(string[] args)
1313
var stopwatch = new System.Diagnostics.Stopwatch();
1414
stopwatch.Start();
1515

16-
var parsedArgs = ArgParser.ParseArgs(args);
17-
1816
try
1917
{
18+
var parsedArgs = ArgParser.ParseArgs(args);
2019
var settings = new Settings(parsedArgs);
2120

2221
if (!settings.ShouldProceedDespiteHighValues())
@@ -30,16 +29,16 @@ public static void Main(string[] args)
3029
fileHandler.CreateFiles();
3130

3231
AnsiConsole.MarkupLine(settings.FileCount == 1
33-
? Resources.CompletedOne
32+
? string.Format(Resources.CompletedOne,
33+
$"{stopwatch.ElapsedMilliseconds:#,##0}ms")
3434
: string.Format(Resources.CompletedZeroOrMultiple,
35-
settings.FileCount.ToString("#,##0")));
35+
settings.FileCount.ToString("#,##0"),
36+
$"{stopwatch.ElapsedMilliseconds:#,##0}ms"));
3637
}
3738
catch (Exception ex)
3839
{
3940
AnsiConsole.MarkupLine($"[red]{Resources.CancelledDueToError} {ex.Message}[/]");
4041
}
41-
42-
AnsiConsole.WriteLine($"Done in {stopwatch.ElapsedMilliseconds:#,##0}ms");
4342
}
4443

4544
private static void PrintInstructions()

UniqueFileGenerator/Resources.resx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@
138138
<comment/>
139139
</data>
140140
<data name="CompletedOne" xml:space="preserve">
141-
<value>1 file created.</value>
142-
<comment/>
141+
<value>1 file created in {0}.</value>
142+
<comment>{0}: the elapsed time.</comment>
143143
</data>
144144
<data name="CompletedZeroOrMultiple" xml:space="preserve">
145-
<value>{0} files created.</value>
146-
<comment>{0}: The file count</comment>
145+
<value>{0} files created in {1}.</value>
146+
<comment>{0}: The file count; {1}: the elapsed time.</comment>
147147
</data>
148148
<data name="DriveSpaceInsufficient" xml:space="preserve">
149149
<value>There is not enough free space on this disk to continue.</value>
@@ -225,4 +225,4 @@
225225
<value>The argument flag "{0}" is not supported.</value>
226226
<comment>{0}: A user-supplied command line argument</comment>
227227
</data>
228-
</root>
228+
</root>

0 commit comments

Comments
 (0)