summaryrefslogtreecommitdiffstats
path: root/krecipes/src/profiling.h
blob: 42f7769fd88799c66a3493690eaf609f491aa3ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/***************************************************************************
*   Copyright (C) 2005 by                                                 *
*   Jason Kivlighn (jkivlighn@gmail.com)                                  *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
***************************************************************************/

#ifndef PROFILING_H
#define PROFILING_H

#ifdef HAVE_CONFIG_H
  #include "config.h"
#endif

#define KRECIPES_PROFILING

#ifdef KRECIPES_PROFILING
  #include <ntqdatetime.h>
  #include <kdebug.h>
  static TQTime dbg_timer;

  #define START_TIMER(MSG) \
   dbg_timer.start(); kdDebug()<<MSG<<endl;
  #define END_TIMER() \
   kdDebug()<<"...took "<<dbg_timer.elapsed()<<" ms"<<endl;
#else
  #define START_TIMER(MSG)
  #define END_TIMER()
#endif

#endif //PROFILING_H