Reputation: 56509
I am trying to generate files and perform write operation in a scheduled process. I need to find out the time taken to generate the files (after write operation is performed). I am little confused in this operation. Can anyone help on this.
Thanks in advance.
Upvotes: 0
Views: 74
Reputation: 223322
You can get the CreationTime
and LastWriteTime
and find their differences.
FileInfo file = new FileInfo("C:\test.text");
Console.WriteLine(file.LastWriteTime);
Console.WriteLine(file.CreationTime);
var timeTaken = file.LastWriteTime - file.CreationTime;
Upvotes: 1