Get time in nanoseconds with Fortran code???
Get time in nanoseconds with Fortran code???
(OP)
For my class I need to find Fortran function that will give me time in nanoseconds.
With date_and_time I can get only milliseconds.
Is there a way to do it?
thanks.
With date_and_time I can get only milliseconds.
Is there a way to do it?
thanks.
RE: Get time in nanoseconds with Fortran code???
but you can measure it only at clk resolution subject
to your clock accuracy.
<nbucska@pcperipherals.com>
RE: Get time in nanoseconds with Fortran code???
If you are using MS Windows... I "think" that the best you can probably hope for is 3 digits behind the decimal point. On my Windows/Fortran system... the tightest timing I ever get back is either to 0.05 or 0.06 seconds... and those are probably only accurate to within 0.1 seconds or something.
Keep in mind.... just because you may get lots of digits back, it doesn't actually mean they are accurate. My guess is there is not a system that you are likely to be working on that is going to give you anything close to nanosecond accuracy ( no matter how many digits you are given ).
Dan
www.dtware.com
RE: Get time in nanoseconds with Fortran code???
unless you have several GHz clock and welldesigned special
hardware.
<nbucska@pcperipherals.com>
RE: Get time in nanoseconds with Fortran code???
If you look up "timer" code through google maybe adding Borland, they have a true microsecond routine and can't remember but I think also nanosecond timer in C code. Looking though these functions, you will be able to see how the code works down at the hardware level and actually changes a few things around to make the ubiquotous PC offhand clock rate work precisely. If you are still in need of the source code email me at: wswain@hippag.com and when I get to work I can send you the C code files. Unfortunately, we have been off fortran for quite some time now so porting the code back may be left to you.
Another thought, look up IRIG time generator on Google as there may be some Fortran code out there for free (maybe?) that meets the IRIG time standard. This may be only to the 10th of a milllisecond or 100 nanosecond resolution.
Good Luck,
Bill
RE: Get time in nanoseconds with Fortran code???
<nbucska@pcperipherals.com>
RE: Get time in nanoseconds with Fortran code???
<nbucska@pcperipherals.com>