Skip to content

Commit 713079b

Browse files
committed
记录实际上创建文件夹耗时
1 parent 9020364 commit 713079b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/MediaConverters/MediaConverters.Lib/Imaging/Optimizations/ImageFileOptimization.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public static async Task<ImageFileOptimizationResult> OptimizeImageFileAsync(Ima
3939

4040
context.LogMessage($"Start optimize image file. File='{imageFile}'");
4141

42+
// Check imageFile Exists Cost 179ms. Total Cost 184ms
4243
if (!File.Exists(imageFile.FullName))
4344
{
4445
// 不能依靠 imageFile.Exists 属性,因为属性可能还没更新
@@ -49,7 +50,15 @@ public static async Task<ImageFileOptimizationResult> OptimizeImageFileAsync(Ima
4950
};
5051
}
5152

53+
stopwatch.Stop();
54+
context.LogMessage($"Check imageFile Exists Cost {stopwatch.ElapsedMilliseconds}ms.");
55+
stopwatch.Restart();
56+
57+
5258
Directory.CreateDirectory(workingFolder.FullName);
59+
stopwatch.Stop();
60+
context.LogMessage($"CreateDirectory workingFolder Cost {stopwatch.ElapsedMilliseconds}ms.");
61+
stopwatch.Restart();
5362

5463
if (copyNewFile)
5564
{

0 commit comments

Comments
 (0)