| 1 |
#ifndef __PerfUtils_hpp__ |
| 2 |
#define __PerfUtils_hpp__ 1 |
| 3 |
|
| 4 |
// ================================================================================================= |
| 5 |
// Copyright 2006 Adobe |
| 6 |
// All Rights Reserved. |
| 7 |
// |
| 8 |
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms |
| 9 |
// of the Adobe license agreement accompanying it. If you have received this file from a source other |
| 10 |
// than Adobe, then your use, modification, or distribution of it requires the prior written permission |
| 11 |
// of Adobe. |
| 12 |
// ================================================================================================= |
| 13 |
|
| 14 |
#if AdobePrivate |
| 15 |
// ================================================================================================= |
| 16 |
// Change history |
| 17 |
// ============== |
| 18 |
// |
| 19 |
// Writers: |
| 20 |
// AWL Alan Lillich |
| 21 |
// ADC Amandeep Chawla |
| 22 |
// |
| 23 |
// mm-dd-yy who Description of changes, most recent on top. |
| 24 |
// |
| 25 |
// 03-21-13 ADC 5.6-f047 [3526905] In MAC and Linux, progress notifications are not returned to the registered callbacks as per the set time-interval. |
| 26 |
// 03-13-13 ADC 5.6-f046 Remove deprecated OSX APIs from XMP toolkit code. |
| 27 |
// |
| 28 |
// 09-21-06 AWL Initial creation. |
| 29 |
// |
| 30 |
// ================================================================================================= |
| 31 |
#endif |
| 32 |
|
| 33 |
#include "public/include/XMP_Environment.h" |
| 34 |
|
| 35 |
#if XMP_MacBuild |
| 36 |
#include <CoreServices/CoreServices.h> |
| 37 |
#elif XMP_WinBuild |
| 38 |
#include <Windows.h> |
| 39 |
#elif XMP_UNIXBuild | XMP_iOSBuild | XMP_AndroidBuild |
| 40 |
#include <time.h> |
| 41 |
#endif |
| 42 |
|
| 43 |
namespace PerfUtils { |
| 44 |
|
| 45 |
#if XMP_WinBuild |
| 46 |
// typedef LARGE_INTEGER MomentValue; |
| 47 |
typedef LONGLONG MomentValue; |
| 48 |
static const MomentValue kZeroMoment = 0; |
| 49 |
#elif XMP_UNIXBuild | XMP_AndroidBuild |
| 50 |
typedef struct timespec MomentValue; |
| 51 |
static const MomentValue kZeroMoment = {0, 0}; |
| 52 |
#elif XMP_iOSBuild | XMP_MacBuild |
| 53 |
typedef uint64_t MomentValue; |
| 54 |
static const MomentValue kZeroMoment = 0; |
| 55 |
#endif |
| 56 |
|
| 57 |
const char * GetTimerInfo(); |
| 58 |
|
| 59 |
MomentValue NoteThisMoment(); |
| 60 |
|
| 61 |
double GetElapsedSeconds ( MomentValue start, MomentValue finish ); |
| 62 |
|
| 63 |
}; // PerfUtils |
| 64 |
|
| 65 |
#endif // __PerfUtils_hpp__ |