A Survey of Gaussian Convolution Algorithms
Functions
basic.c File Reference

Portable types, math constants, and timing. More...

Detailed Description

Portable types, math constants, and timing.

Author
Pascal Getreuer getre.nosp@m.uer@.nosp@m.cmla..nosp@m.ens-.nosp@m.cacha.nosp@m.n.fr

Copyright (c) 2010-2013, Pascal Getreuer All rights reserved.

This program is free software: you can redistribute it and/or modify it under, at your option, the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, or the terms of the simplified BSD license.

You should have received a copy of these licenses along with this program. If not, see http://www.gnu.org/licenses/ and http://www.opensource.org/licenses/bsd-license.html.

Definition in file basic.c.

#include "basic.h"
#include <time.h>

Go to the source code of this file.

Functions

unsigned long millisecond_timer ()
 Millisecond-precision timer function. More...
 

Function Documentation

unsigned long millisecond_timer ( )

Millisecond-precision timer function.

Returns
Clock value in units of milliseconds

This routine implements a timer with millisecond precision. In order to obtain timing at high resolution, platform-specific functions are needed:

  • On Windows systems, the GetSystemTime function is used.
  • On POSIX systems, the gettimeofday function is used.

Otherwise as a fallback, time.h time is used, and in this case millisecond_timer() has only second accuracy. Preprocessor symbols are checked in attempt to detect whether the platform is POSIX or Windows and defines millisecond_timer() accordingly. A particular implementation can be forced by defining USE_GETSYSTEMTIME, USE_GETTIMEOFDAY, or USE_TIME.

Definition at line 63 of file basic.c.