Returns the CPU time in seconds used by the process.
PetscErrorCode PetscGetCPUTime(PetscLogDouble *t)
|t ||- Time in seconds charged to the process.
PetscLogDouble t1, t2;
ierr = PetscGetCPUTime(&t1);CHKERRQ(ierr);
... code to time ...
ierr = PetscGetCPUTime(&t2);CHKERRQ(ierr);
printf("Code took %f CPU seconds\n", t2-t1);
One should use PetscTime() or the -log_view option of
PETSc for profiling. The CPU time is NOT a realistic number to
use since it does not include the time for message passing etc.
Also on many systems the accuracy is only on the order of microseconds.
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages