diff options
| author | Antonin Descampe <antonin@gmail.com> | 2016-01-25 23:22:06 +0100 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2016-01-25 23:22:06 +0100 |
| commit | 0febbff19e05cb1a6c2613eee76ad46a669c96cd (patch) | |
| tree | b6442d01348e2ba6404d0fd6abcc4eb6d6cc1390 /src/lib/openmj2/j2k_lib.c | |
| parent | bede1568b197021bb576b935422af6c1d0a79e21 (diff) | |
processed all c/h files through astyle with opj_astyle.cfgcodingstyle
Diffstat (limited to 'src/lib/openmj2/j2k_lib.c')
| -rw-r--r-- | src/lib/openmj2/j2k_lib.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/openmj2/j2k_lib.c b/src/lib/openmj2/j2k_lib.c index 1359812f..9b1d81b5 100644 --- a/src/lib/openmj2/j2k_lib.c +++ b/src/lib/openmj2/j2k_lib.c @@ -1,6 +1,6 @@ /* - * The copyright in this software is being made available under the 2-clauses - * BSD License, included below. This software may be subject to other third + * The copyright in this software is being made available under the 2-clauses + * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * @@ -38,24 +38,25 @@ #endif /* _WIN32 */ #include "opj_includes.h" -double OPJ_CALLCONV opj_clock(void) { +double OPJ_CALLCONV opj_clock(void) +{ #ifdef _WIN32 - /* _WIN32: use QueryPerformance (very accurate) */ + /* _WIN32: use QueryPerformance (very accurate) */ LARGE_INTEGER freq , t ; /* freq is the clock speed of the CPU */ QueryPerformanceFrequency(&freq) ; - /* cout << "freq = " << ((double) freq.QuadPart) << endl; */ + /* cout << "freq = " << ((double) freq.QuadPart) << endl; */ /* t is the high resolution performance counter (see MSDN) */ QueryPerformanceCounter ( & t ) ; return ( t.QuadPart /(double) freq.QuadPart ) ; #else - /* Unix or Linux: use resource usage */ + /* Unix or Linux: use resource usage */ struct rusage t; double procTime; /* (1) Get the rusage data structure at this moment (man getrusage) */ getrusage(0,&t); /* (2) What is the elapsed time ? - CPU time = User time + System time */ - /* (2a) Get the seconds */ + /* (2a) Get the seconds */ procTime = t.ru_utime.tv_sec + t.ru_stime.tv_sec; /* (2b) More precisely! Get the microseconds part ! */ return ( procTime + (t.ru_utime.tv_usec + t.ru_stime.tv_usec) * 1e-6 ) ; |
