~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/blenlib/PIL_time.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 */
52
52
void    PIL_sleep_ms(int ms);
53
53
 
54
 
/** Utility defines for timing.
55
 
 * requires BLI_utildefines.h for 'AT'
56
 
 * TIMEIT_VALUE returns the time since TIMEIT_START was called.
57
 
 */
58
 
#define TIMEIT_START(var)                                                     \
59
 
        {                                                                         \
60
 
                double _timeit_##var = PIL_check_seconds_timer();                     \
61
 
                printf("time start (" #var "):  " AT "\n");                           \
62
 
                fflush(stdout);                                                       \
63
 
                { (void)0
64
 
 
65
 
#define TIMEIT_VALUE(var) (float)(PIL_check_seconds_timer() - _timeit_##var)
66
 
 
67
 
#define TIMEIT_VALUE_PRINT(var)                                               \
68
 
        {                                                                         \
69
 
                printf("time update(" #var "): %.6f" "  " AT "\n", TIMEIT_VALUE(var));\
70
 
                fflush(stdout);                                                       \
71
 
        } (void)0
72
 
 
73
 
#define TIMEIT_END(var)                                                       \
74
 
        }                                                                         \
75
 
        printf("time end   (" #var "): %.6f" "  " AT "\n", TIMEIT_VALUE(var));    \
76
 
        fflush(stdout);                                                           \
77
 
} (void)0
78
 
 
79
 
/**
80
 
 * Given some function/expression:
81
 
 *   TIMEIT_BENCH(some_function(), some_unique_description);
82
 
 */
83
 
#define TIMEIT_BENCH(expr, id)                                                \
84
 
        {                                                                         \
85
 
                TIMEIT_START(id);                                                     \
86
 
                (expr);                                                               \
87
 
                TIMEIT_END(id);                                                       \
88
 
        } (void)0
89
 
 
90
54
#ifdef __cplusplus
91
55
}
92
56
#endif
93
57
 
94
 
#endif  /* !__PIL_TIME_H__ */
 
58
#endif  /* __PIL_TIME_H__ */