update to the rusage command:
print total analysis time, total elapsed time, and memory information (OS dependant) if rusage is given without parameters
This commit is contained in:
parent
f07c73b6a5
commit
7e4b68c708
|
|
@ -124,7 +124,8 @@ com_rusage(wordlist *wl)
|
|||
(void) putc('\n', cp_out);
|
||||
}
|
||||
} else {
|
||||
printres("cputime");
|
||||
printf("\n");
|
||||
printres("time");
|
||||
(void) putc('\n', cp_out);
|
||||
printres("totalcputime");
|
||||
(void) putc('\n', cp_out);
|
||||
|
|
@ -189,6 +190,7 @@ printres(char *name)
|
|||
char *paramname = NULL;
|
||||
#endif
|
||||
bool yy = FALSE;
|
||||
static bool called = FALSE;
|
||||
static long last_sec = 0, last_msec = 0;
|
||||
struct variable *v, *vfree = NULL;
|
||||
char *cpu_elapsed;
|
||||
|
|
@ -237,7 +239,7 @@ printres(char *name)
|
|||
}
|
||||
|
||||
if (!name || eq(name, "totalcputime")) {
|
||||
fprintf(cp_out, "Total %s time: %u.%03u seconds.\n",
|
||||
fprintf(cp_out, "Total %s time (seconds) = %u.%03u \n",
|
||||
cpu_elapsed, total_sec, total_msec);
|
||||
}
|
||||
|
||||
|
|
@ -248,12 +250,14 @@ printres(char *name)
|
|||
last_msec -= 1000;
|
||||
last_sec += 1;
|
||||
}
|
||||
#ifndef HAVE_WIN32
|
||||
fprintf(cp_out, "%s time since last call: %lu.%03lu seconds.\n",
|
||||
cpu_elapsed, last_sec, last_msec);
|
||||
#endif
|
||||
/* do not print it the first time, doubling totalcputime */
|
||||
if (called)
|
||||
fprintf(cp_out, "%s time since last call seconds) = %lu.%03lu \n",
|
||||
cpu_elapsed, last_sec, last_msec);
|
||||
|
||||
last_sec = total_sec;
|
||||
last_msec = total_msec;
|
||||
called = TRUE;
|
||||
}
|
||||
|
||||
#ifdef XSPICE
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ static IFparm OPTtbl[] = {
|
|||
{ "tranpoints", OPT_TRANPTS, IF_ASK|IF_INTEGER,"Transient timepoints" },
|
||||
{ "accept", OPT_TRANACCPT, IF_ASK|IF_INTEGER,"Accepted timepoints" },
|
||||
{ "rejected", OPT_TRANRJCT, IF_ASK|IF_INTEGER,"Rejected timepoints" },
|
||||
{ "time", OPT_TOTANALTIME, IF_ASK|IF_REAL,"Total analysis time" },
|
||||
{ "time", OPT_TOTANALTIME, IF_ASK|IF_REAL,"Total analysis time (seconds)" },
|
||||
{ "loadtime", OPT_LOADTIME, IF_ASK|IF_REAL,"Matrix load time" },
|
||||
{ "synctime", OPT_SYNCTIME, IF_ASK|IF_REAL,"Matrix synchronize time" },
|
||||
{ "reordertime", OPT_REORDTIME, IF_ASK|IF_REAL,"Matrix reorder time" },
|
||||
|
|
@ -305,7 +305,7 @@ static IFparm OPTtbl[] = {
|
|||
{ "transolvetime", OPT_TRANSOLVE, IF_ASK|IF_REAL,"Transient solve time" },
|
||||
{ "trantrunctime", OPT_TRANTRUNC, IF_ASK|IF_REAL,"Transient trunc time" },
|
||||
{ "trancuriters", OPT_TRANCURITER, IF_ASK|IF_INTEGER,
|
||||
"Transient iters per point" },
|
||||
"Transient iterations for the last time point" },
|
||||
{ "actime", OPT_ACTIME, IF_ASK|IF_REAL,"AC analysis time" },
|
||||
{ "acloadtime", OPT_ACLOAD, IF_ASK|IF_REAL,"AC load time" },
|
||||
{ "acsynctime", OPT_ACSYNC, IF_ASK|IF_REAL,"AC sync time" },
|
||||
|
|
|
|||
Loading…
Reference in New Issue