Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
UERANSIM
Commits
01391ec9
Commit
01391ec9
authored
Dec 24, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance improvements
parent
9ca343a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
src/utils/common.cpp
src/utils/common.cpp
+14
-5
src/utils/common.hpp
src/utils/common.hpp
+2
-0
No files found.
src/utils/common.cpp
View file @
01391ec9
...
...
@@ -148,11 +148,20 @@ int utils::NextId()
int64_t
utils
::
CurrentTimeMillis
()
{
auto
time
=
std
::
chrono
::
system_clock
::
now
();
auto
sinceEpoch
=
time
.
time_since_epoch
();
auto
millis
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
sinceEpoch
);
int64_t
now
=
millis
.
count
();
return
now
;
return
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
std
::
chrono
::
system_clock
::
now
().
time_since_epoch
())
.
count
();
}
int64_t
utils
::
CurrentTimeMicros
()
{
return
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
std
::
chrono
::
system_clock
::
now
().
time_since_epoch
())
.
count
();
}
int64_t
utils
::
CurrentTimeNanos
()
{
return
std
::
chrono
::
duration_cast
<
std
::
chrono
::
nanoseconds
>
(
std
::
chrono
::
system_clock
::
now
().
time_since_epoch
())
.
count
();
}
TimeStamp
utils
::
CurrentTimeStamp
()
...
...
src/utils/common.hpp
View file @
01391ec9
...
...
@@ -28,6 +28,8 @@ int GetIpVersion(const std::string &address);
OctetString
IpToOctetString
(
const
std
::
string
&
address
);
std
::
string
OctetStringToIp
(
const
OctetString
&
address
);
int64_t
CurrentTimeMillis
();
int64_t
CurrentTimeMicros
();
int64_t
CurrentTimeNanos
();
TimeStamp
CurrentTimeStamp
();
int
NextId
();
int
ParseInt
(
const
std
::
string
&
str
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment