Last change
on this file since 2328 was
1754,
checked in by ymipsl, 5 years ago
|
exporting the timer functionnalities to fortran via the interface
YM
|
-
Property svn:eol-style set to
native
|
File size:
826 bytes
|
Rev | Line | |
---|
[1754] | 1 | #include "timer.hpp" |
---|
| 2 | #include <string> |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | using namespace xios; |
---|
| 6 | |
---|
| 7 | extern "C" |
---|
| 8 | { |
---|
| 9 | void cxios_timer_resume(const char* timer_id, int len_timer_id, bool trace) |
---|
| 10 | { |
---|
| 11 | std::string str(timer_id,len_timer_id); |
---|
| 12 | CTimer::get(str).resume(); |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | void cxios_timer_suspend(const char* timer_id, int len_timer_id, bool trace) |
---|
| 16 | { |
---|
| 17 | std::string str(timer_id,len_timer_id); |
---|
| 18 | CTimer::get(str).suspend(); |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | void cxios_timer_reset(const char* timer_id, int len_timer_id) |
---|
| 22 | { |
---|
| 23 | std::string str(timer_id,len_timer_id); |
---|
| 24 | CTimer::get(str).reset(); |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | void cxios_timer_get_time(double* time) |
---|
| 28 | { |
---|
| 29 | *time=CTimer::getTime(); |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | void cxios_timer_get_cumulated_time(const char* timer_id, int len_timer_id, double* time) |
---|
| 33 | { |
---|
| 34 | std::string str(timer_id,len_timer_id); |
---|
| 35 | *time=CTimer::get(str).getCumulatedTime(); |
---|
| 36 | } |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | |
---|
Note: See
TracBrowser
for help on using the repository browser.