In article <C690F1.745@tierzucht-mariensee.fal-braunschweig.de>, Eildert Groeneveld <eg@tierzucht-mariensee.fal-braunschweig.dbp.de> writes:
|> we have ported some rather substantial Fortran code to
|> Linux. On the whole, it worked great. However, I do need
|> some timing routines. Does there exist a BSD compatibility
|> library that has DTIME, FDATE etc (from FORTRAN that is).
|> Also, I sorely missing IEOR from FORTRAN.
|>
|> Any pointers would be appeciated.
|>
|> Eildert Groeneveld
I'm not sure if this is exactly what you're looking for for timing
(and I don't know about the date), but here's a little subroutine
that is callable from both fortran and C that I use for measuring
CPU time.
==========cut here
/* measure execution time in seconds */
/* Bill Mitchell 10/9/92 */
/* */
/* Use unix routine"times"to measure */
/* user execution time between */
/* calls to second in seconds. */
/* Callable from FORTRAN and C. */
/* Returns double precsion (real*8) */
/* in FORTRAN and double in C. */
/* FORTRAN callable version */
static int holdtime,flagtime=1;
double second_()
{
/* just call C version */
double second();
return second();
}
/* C callable version */
double second()
{
#include <sys/types.h>
#include <sys/times.h>
#include <sys/param.h>
clock_t times();
clock_t t;
struct tms t1;
/* call "times" */
t=times(&t1);
/* user time in 1/HZ seconds is in tms_utime */
/* HZ is in sys/param.h */
return ((double)t1.tms_utime)/HZ;
}
============cut here
--
-- Bill
William F. Mitchell | wmitchell@atl.ge.com
Martin Marietta Adv. Tech. Labs | na.mitchell@na-net.ornl.gov
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Jeff Garzik | Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
| Chodorenko Michail | PROBLEM: Celeron Core |
git: | |
| Linus Torvalds | People unaware of the importance of "git gc"? |
| Johannes Schindelin | Re: Empty directories... |
| Jakub Narebski | Re: VCS comparison table |
| Sam Song | Re: Fwd: [OT] Re: Git via a proxy server? |
| J.W. Zondag | Dell PE1950 III - Perc 6i |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Anselm R. Garbe | OpenBSD 4.0 / Xorg -> vesa 1920x1200 widescreen resolution |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Anselm Lingnau | File creation date in UNIX (was: Re: VMS) |
| Rafal Kustra (summer student) | mount |
| Nicholas Yue | Re: more on 486/33 weirdness |
