petsc-3.3-p7 2013-05-11

PetscGetTime

Returns the current time of day in seconds. This returns wall-clock time.

Synopsis

PetscErrorCode  PetscGetTime(PetscLogDouble *t)
Not Collective

Output Parameter

v -time counter

Usage

      #include <petsctime.h>

      PetscLogDouble v1,v2,elapsed_time;
      ierr = PetscGetTime(&v1);CHKERRQ(ierr);
      .... perform some calculation ...
      ierr = PetscGetTime(&v2);CHKERRQ(ierr);
      elapsed_time = v2 - v1;   

Notes

Requires explicitly including "petsctime.h"

Since the PETSc libraries incorporate timing of phases and operations, PetscGetTime() is intended only for timing of application codes. The options database commands -log, -log_summary, and -log_all activate PETSc library timing.

See Also

PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscLogStagePush(),
PetscLogStagePop(), PetscLogStageRegister(), PetscGetFlops()

Keywords

get, time

Level:intermediate
Location:
src/sys/time/ptime.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/sys/threadcomm/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex10.c.html
src/ksp/ksp/examples/tutorials/ex42.c.html