getting time stamp in micro or milli scronds

hi
I want to get the file creaton times in micro or milli seconds. Can any one help me in how to get it using a C++ program?
Try with 'clock' from ctime http://www.cplusplus.com/reference/clibrary/ctime/clock/
eg:
1
2
3
clock_t before = clock();
//create your file
clock_t result = clock() - before;
The result can be in micro or milliseconds, to know that see the value of CLOCKS_PER_SEC
Hi Bazzy..
Thanks for ur reply..

But I'm not creating the file, i want only the timestamp of the already existing files through my C code..
glibc has st_ctimensec (ctime nanoseconds) as part of struct stat. Most filesystems don't keep file times that accurately. And I have no idea how portable it is.
Topic archived. No new replies allowed.