- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, everyone!
I use dclock (with "use ifport") to time my application. It works perfect for a short run, i.e. 300 second. But for a long run, i.e. 1 or 2 days, it gives a negative run time. Could anyone give an explanation for this?
Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Very interesting. I waded through the source code for DCLOCK (actually, the SECNDS routine it calls internally), and I see that it tries to account for spanning midnight but only over one day. It can't handle a period longer than two days. I recommend the use of the Fortran standard intrinsic SYSTEM_CLOCK instead - it can deal with longer spans.
I will ask the developers to fix DCLOCK as it should not be based on SECNDS. Issue ID is DPD200243198.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Steve!
Actually, my current solution is to use "gettimeofday" from C. "SYSTEM_CLOCK" seems to be better. I guess I can get a resolution of one microsecond. :D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We've corrected the implementation of DCLOCK for a release later this year. I would caution you that the resolution is dependent on how often the OS updates the elapsed time clock. I think Linux does tend to do it every microsecond, but just because the value you get has a precision of microseconds, that doesn't mean the resolution (gap between increments) is the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Steve! I always learn something useful from this forum.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page