Different computers and operating systems vary wildly in how they keep track of processor time. It's common for the internal processor clock to have a resolution somewhere between hundredths and millionths of a second.
As such its possible that the time to open a file is faster that what clock measures.
To get a better average I suggest:
[list:0507a6cee9]
- create 100 files (perhaps write a program to do this)
- take a time measurement with clock()
- open all 100 files (I think you can do this, so Op have a limit on the number of file handles you can have open)
- take final time measurement.
- calculate time and output.
Either way, I would expect the fopen/fclose (or whatever you're using) to be quick, since its merely checking for the existance of the file.
Login