Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
1555aefd
Commit
1555aefd
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Check that the required system functions are present at configure time
parent
b3e9532a
No related branches found
No related tags found
2 merge requests
!136
Master
,
!107
Code timing and verbosity
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure.ac
+1
-1
1 addition, 1 deletion
configure.ac
src/clocks.c
+12
-0
12 additions, 0 deletions
src/clocks.c
with
13 additions
and
1 deletion
configure.ac
+
1
−
1
View file @
1555aefd
...
...
@@ -329,7 +329,7 @@ is defined in <sys/time.h>])],,
[#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif])
AC_CHECK_FUNCS([gethrtime read_real_time time_base_to_time clock_gettime mach_absolute_time])
AC_CHECK_FUNCS([gethrtime read_real_time time_base_to_time clock_gettime mach_absolute_time
strftime gettimeofday localtime
])
AC_MSG_CHECKING([for _rtc intrinsic])
rtc_ok=yes
AC_LINK_IFELSE([AC_LANG_PROGRAM(
...
...
This diff is collapsed.
Click to expand it.
src/clocks.c
+
12
−
0
View file @
1555aefd
...
...
@@ -222,8 +222,17 @@ double clocks_from_ticks(ticks tics) {
*/
const
char
*
clocks_getunit
()
{
return
clocks_units
[
clocks_units_index
];
}
/**
* @brief returns a string containing the local date and time
*
* The date is return in the format [YYYY-MM-DD hh:mm:ss]
*
* @result the current time.
*/
const
char
*
clocks_get_timeofday
()
{
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_LOCALTIME) && \
defined(HAVE_STRFTIME)
struct
timeval
time
;
struct
tm
*
local_time
;
static
char
buffer
[
40
];
...
...
@@ -235,5 +244,8 @@ const char *clocks_get_timeofday() {
/* Make it a string */
strftime
(
buffer
,
40
,
"[%F %T]"
,
local_time
);
#else
static
char
buffer
[
40
]
=
"[Unknown time]"
;
#endif
return
buffer
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment