Lolly
1.4.28
Loading...
Searching...
No Matches
System
Classes
tm_timer.cpp
Go to the documentation of this file.
1
2
/******************************************************************************
3
* MODULE : timer.cpp
4
* DESCRIPTION: timers
5
* COPYRIGHT : (C) 1999 Joris van der Hoeven
6
*******************************************************************************
7
* This software falls under the GNU general public license version 3 or later.
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10
******************************************************************************/
11
12
#include "
tm_timer.hpp
"
13
#include "
basic.hpp
"
14
#include "
iterator.hpp
"
15
#include "
merge_sort.hpp
"
16
#include "
tm_ostream.hpp
"
17
18
#include "tbox/tbox.h"
19
20
/******************************************************************************
21
* Getting the time
22
******************************************************************************/
23
time_t
24
get_sec_time
() {
25
tb_timeval_t
tp
= {0};
26
tb_gettimeofday
(&
tp
,
tb_null
);
27
return
(
time_t
)
tp
.tv_sec;
28
}
29
30
time_t
31
get_usec_time
() {
32
tb_timeval_t
tp
= {0};
33
tb_gettimeofday
(&
tp
,
tb_null
);
34
return
(
time_t
)
tp
.tv_usec;
35
}
36
37
time_t
38
raw_time
() {
39
tb_timeval_t
tp
= {0};
40
tb_gettimeofday
(&
tp
,
tb_null
);
41
return
(
time_t
) ((
tp
.tv_sec * 1000) + (
tp
.tv_usec / 1000));
42
}
43
44
static
time_t
start_time
=
raw_time
();
45
46
time_t
47
texmacs_time
() {
48
tb_timeval_t
tp
= {0};
49
tb_gettimeofday
(&
tp
,
tb_null
);
50
return
((
time_t
) ((
tp
.tv_sec * 1000) + (
tp
.tv_usec / 1000))) -
start_time
;
51
}
basic.hpp
list
The list class represents a linked list.
Definition
list.hpp:48
iterator.hpp
merge_sort.hpp
tm_ostream.hpp
get_usec_time
time_t get_usec_time()
Definition
tm_timer.cpp:31
texmacs_time
time_t texmacs_time()
Definition
tm_timer.cpp:47
raw_time
time_t raw_time()
Definition
tm_timer.cpp:38
start_time
static time_t start_time
Definition
tm_timer.cpp:44
get_sec_time
time_t get_sec_time()
Definition
tm_timer.cpp:24
tm_timer.hpp
Generated by
1.10.0