Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F621784
time.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
479 B
Referenced Files
None
Subscribers
None
time.cpp
View Options
#include
<network/time.h>
#ifdef _MSC_VER
#include
<Windows.h>
#endif
namespace
net
{
#ifdef _MSC_VER
void
time_now
(
time
&
tm
)
{
tm
=
timeGetTime
();
}
#elif defined(__GNUC__)
void
time_now
(
time
&
tm
)
{
timeval
tv
;
gettimeofday
(
&
tv
,
0
);
uint64_t
value
=
0
;
value
+=
tv
.
tv_sec
*
1000
;
value
+=
tv
.
tv_usec
/
1000
;
tm
=
(
time
)
value
;
}
#endif
uint64_t
time_diff
(
time
&
from
,
time
&
to
)
{
return
to
-
from
;
}
void
time_add
(
time
&
base
,
int64_t
add_ms
)
{
base
+=
add_ms
;
}
};
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sat, Nov 14, 7:29 PM (20 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
140417
Default Alt Text
time.cpp (479 B)
Attached To
Mode
R80 StarRuler2-Source
Attached
Detach File
Event Timeline