=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/time.c,v retrieving revision 1.3 retrieving revision 1.6 diff -u -p -r1.3 -r1.6 --- OpenXM_contrib2/asir2000/builtin/time.c 2000/08/22 05:04:00 1.3 +++ OpenXM_contrib2/asir2000/builtin/time.c 2008/09/11 15:17:55 1.6 @@ -45,17 +45,19 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/builtin/time.c,v 1.2 2000/08/21 08:31:21 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/time.c,v 1.5 2005/11/12 08:13:13 noro Exp $ */ #include "ca.h" #include "parse.h" void Ptime(), Pcputime(), Pcurrenttime(), Ptstart(), Ptstop(); +void Pdcurrenttime(); struct ftab time_tab[] = { {"time",Ptime,0}, {"cputime",Pcputime,1}, {"currenttime",Pcurrenttime,0}, + {"dcurrenttime",Pdcurrenttime,0}, {"tstart",Ptstart,0}, {"tstop",Ptstop,0}, {0,0,0}, @@ -73,6 +75,14 @@ Q *rp; t = (int)get_current_time(); STOQ(t,*rp); } +void Pdcurrenttime(rp) +Real *rp; +{ + double t; + + t = get_current_time(); MKReal(t,*rp); +} + void Ptstart(rp) pointer *rp; { @@ -103,12 +113,24 @@ LIST *listp; Real re,rg,rr; NODE a,b,w,r; Q words; - int t; + long t; + int u,l; + N n; double rtime; double get_rtime(); rtime = get_rtime(); MKReal(rtime,rr); - t = get_allocwords(); STOQ(t,words); + t = get_allocwords(); +#if defined(LONG_IS_64BIT) + u = t>>32; l = t&(0xffffffff); + if ( !u ) STOQ(l,words); + else { + n = NALLOC(2); PL(n)=2; BD(n)[0] = l; BD(n)[1] = u; + NTOQ(n,1,words); + } +#else + STOQ(t,words); +#endif get_eg(&eg); MKReal(eg.exectime,re); MKReal(eg.gctime,rg); MKNODE(r,rr,0); MKNODE(w,words,r); MKNODE(a,rg,w); MKNODE(b,re,a); MKLIST(*listp,b);