Link to home
Create AccountLog in
Avatar of rye004
rye004Flag for United States of America

asked on

Looking for a way to measure export performance of a text file export.

I have written an application that exports text files.  I am trying to find the best way to measure performance of my export by looking at the date create of the text file that I am exporting.  My program has many different export methods and I am trying to see which ones work the best.

Does anyone have any ideas of how I can measure performance by looking at the exported files? What I would like to do is get an average of how many export per minute and if possible see some type of time line of performance.  This would help me understand if my export gets slower over time.  I have tried using Excel for this, but wanted to see if there is anything already made to do this.

Also, I don’t want to add additional code to my application to log performance.  I am trying to keep my code as optimal as possible.

I am running this on Windows 7 and 8 64 bit.

Avatar of Neil Russell
Neil Russell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of arnold
As pointed out, you can not determine the performance of the export by looking at the file directly. Look at the ctime of the file and the mtime of the file to see whether it provides the time difference between the crate timestamp to modify.
Though I thing most of the processing time deals with aggregating the data that is exported. So in comparison the amount of time spent actually writing to disk I/O is likely insignificant compared to the processing of the data.
Um, have you considered just profiling the code using a profier?
you could call GetFileTime after export and retrieve timestamps of lpCreationTime and lpLastWriteTime. the values are of type FILETIME which could be reinterpreted as 64-bit integers representing nanoseconds since 1/1/1601. so you could take the difference of this values and have the time span in nanoseconds. if you apply the divisor 1 million you would get the time in milliseconds what probably is a reasonable unit.

__int64 ct = *(reinterpret_cast<__int64*> lpCreationTime); 
__int64 wt = * (reinterpret_cast<__int64*> lpLastWriteTime); 
__int64 msd = (wt - ct)/1000000;

Open in new window

the code was not tested and has missing opening brackets.
Avatar of rye004


sorry for the limited points.  I am still getting use to how this web site works.