#include "petscsys.h" PetscErrorCode PetscGetCPUTime(PetscLogDouble *t)Not Collective
#include <petscsys.h>
...
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);
Level:intermediate
Location:src/sys/time/cputime.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages