Quote:
|
Originally Posted by Bhups
cum to the rescue sir  ....a beginner conjures ur help  ...???
|
You can't squeeze blood from a stone. The standard unix date command doesn't do milliseconds. Posix says: "The resolution of the system clock is unspecified.", but they make it clear elsewhere that a resolution of at least one second is required. Posix does demand that the system clock system calls supply an interface that supports microseconds. But you may not write a portable unix program that needs milliseconds. But as a practical matter, all modern systems will have at least millisecond resolution. But you won't find a standard unix utiliity that supports milliseconds. So you need another program to call from your shell script. Either GNU date or that little utility in the linked thread will do. And don't expect it to work well on any real old unix systems. In fact, even on a modern computer, several milliseconds may occur between the time your script obtains the milliseconds and communicates the timestamp to the outside world. Scripts need to fork and exec external programs to do stuff. That is not conducive to millisecond resolution.You may need to write your program in completely in C and/or use realtime extentions.
(Hmmmm: Vino is dividing the output of %N by 1000000 which implies that %N returns
nanoseconds. I'll have to look into that. It's not obvious how to get nanoseconds....)