-rw-r--r-- | library/qpedebug.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/qpedebug.cpp b/library/qpedebug.cpp index 29bcbb6..b7cbc7b 100644 --- a/library/qpedebug.cpp +++ b/library/qpedebug.cpp | |||
@@ -1,51 +1,51 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "qpedebug.h" | 21 | #include "qpedebug.h" |
22 | #include <stdio.h> | 22 | #include <stdio.h> |
23 | #include <sys/time.h> | 23 | #include <sys/time.h> |
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | 25 | ||
26 | struct timeval qpe_debuglast; | 26 | struct timeval qpe_debuglast; |
27 | 27 | ||
28 | void qpe_debugTime( const char *file, int line, const char *desc ) | 28 | void qpe_debugTime( const char *file, int line, const char *desc ) |
29 | { | 29 | { |
30 | struct timeval tv; | 30 | struct timeval tv; |
31 | gettimeofday( &tv, 0 ); | 31 | gettimeofday( &tv, 0 ); |
32 | 32 | ||
33 | int tdiff = tv.tv_usec - qpe_debuglast.tv_usec; | 33 | int tdiff = tv.tv_usec - qpe_debuglast.tv_usec; |
34 | tdiff += (tv.tv_sec - qpe_debuglast.tv_sec) * 1000000; | 34 | tdiff += (tv.tv_sec - qpe_debuglast.tv_sec) * 1000000; |
35 | 35 | ||
36 | fprintf( stderr, "%s:%d Time: %ld.%06ld", file, line, tv.tv_sec, tv.tv_usec); | 36 | fprintf( stderr, "%s:%d Time: %ld.%06ld", file, line, tv.tv_sec, tv.tv_usec); |
37 | 37 | ||
38 | static int pid = getpid(); | 38 | static int pid = getpid(); |
39 | 39 | ||
40 | if ( qpe_debuglast.tv_sec ) | 40 | if ( qpe_debuglast.tv_sec ) |
41 | fprintf( stderr, " (pid %d delta %dus)", pid, tdiff ); | 41 | fprintf( stderr, " (pid %d delta %dus)", pid, tdiff ); |
42 | 42 | ||
43 | if ( desc ) | 43 | if ( desc ) |
44 | fprintf( stderr, " (%s)", desc ); | 44 | fprintf( stderr, " (%s)", desc ); |
45 | 45 | ||
46 | fprintf( stderr, "\n" ); | 46 | fprintf( stderr, "\n" ); |
47 | 47 | ||
48 | qpe_debuglast = tv; | 48 | qpe_debuglast = tv; |
49 | } | 49 | } |
50 | 50 | ||
51 | 51 | ||