Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Toolbox/TimerLogger.h @ 2068:22a83fb9dd23 deep-learning
added AlignedMatrix and TimerLogger
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 17 May 2023 17:30:52 +0200 |
parents | |
children |
rev | line source |
---|---|
2068
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * the License, or (at your option) any later version. |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * License along with this program. If not, see |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 **/ |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #pragma once |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include <boost/noncopyable.hpp> |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 #include <string> |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 #if defined(__EMSCRIPTEN__) |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 # include <emscripten.h> |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 #else |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 # include <boost/date_time/posix_time/posix_time_types.hpp> |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 #endif |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 namespace OrthancStone |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 { |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 class TimerLogger : public boost::noncopyable |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 { |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 private: |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 std::string name_; |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 #if defined(__EMSCRIPTEN__) |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 double start_; |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 #else |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 boost::posix_time::ptime start_; |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 #endif |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 public: |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 TimerLogger(const std::string& name); |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 ~TimerLogger(); |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 }; |
22a83fb9dd23
added AlignedMatrix and TimerLogger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 } |