timestamp granularity

I tried searching in the forums, couldnt find anything.

Is it possible to get more granular than seconds? For example, in milliseconds or nanoseconds? The date command only goes so far as seconds. Any other way?

-S

Well, it didn't take me long to find time in microseconds

thats a good search criteria! i didnt think of trying that.

thanks.

-S

it worked well....but i just had a thought. Is it possible to get that level of granularity with files? I know you can get the second a file was created with this:

command line
---------------
perl -e '@d=localtime ((stat(shift))[9]); printf "%02d-%02d-%04d %02d:%02d:%02d\n", $d[3],$d[4]+1,$d[5]+1900,$d[2],$d[1],$d[0]' /tmp/dummyfile.txt

output
-------
21-03-2007 13:28:01

Is it possible to get more granular? something like this?

21-02-2007 13:28:01 875022

Thanks.

-S

With most filesystem formats the timestamps are to the second only. Unix is evolving towards nanosecond timestamps, but it is not probable that your OS has them now.