Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
839d119c
Commit
839d119c
authored
Sep 26, 2014
by
Charles Blake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-organize so libc.time holds standard C things and posix.time POSIX things.
parent
4dc81469
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
59 deletions
+63
-59
Cython/Includes/libc/time.pxd
Cython/Includes/libc/time.pxd
+10
-55
Cython/Includes/posix/time.pxd
Cython/Includes/posix/time.pxd
+53
-4
No files found.
Cython/Includes/libc/time.pxd
View file @
839d119c
# http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html
from
posix.signal
cimport
sigevent
from
posix.types
cimport
clock_t
,
clockid_t
,
suseconds_t
,
time_t
,
timer_t
from
libc.stddef
cimport
wchar_t
cdef
extern
from
"time.h"
nogil
:
enum
:
CLOCKS_PER_SEC
enum
:
CLOCK_PROCESS_CPUTIME_ID
enum
:
CLOCK_THREAD_CPUTIME_ID
enum
:
CLOCK_REALTIME
enum
:
TIMER_ABSTIME
enum
:
CLOCK_MONOTONIC
# FreeBSD-specific clocks
enum
:
CLOCK_UPTIME
enum
:
CLOCK_UPTIME_PRECISE
enum
:
CLOCK_UPTIME_FAST
enum
:
CLOCK_REALTIME_PRECISE
enum
:
CLOCK_REALTIME_FAST
enum
:
CLOCK_MONOTONIC_PRECISE
enum
:
CLOCK_MONOTONIC_FAST
enum
:
CLOCK_SECOND
# Linux-specific clocks
enum
:
CLOCK_PROCESS_CPUTIME_ID
enum
:
CLOCK_THREAD_CPUTIME_ID
enum
:
CLOCK_MONOTONIC_RAW
enum
:
CLOCK_REALTIME_COARSE
enum
:
CLOCK_MONOTONIC_COARSE
enum
:
CLOCK_BOOTTIME
enum
:
CLOCK_REALTIME_ALARM
enum
:
CLOCK_BOOTTIME_ALARM
cdef
struct
timespec
:
time_t
tv_sec
long
tv_nsec
cdef
struct
itimerspec
:
timespec
it_interval
timespec
it_value
clock_t
clock
()
# CPU time
time_t
time
(
time_t
*
)
# wall clock time since Unix epoch
cdef
struct
tm
:
int
tm_sec
...
...
@@ -54,14 +21,13 @@ cdef extern from "time.h" nogil:
char
*
tm_zone
long
tm_gmtoff
int
daylight
# global state
long
timezone
char
*
tzname
[
2
]
void
tzset
()
char
*
asctime
(
const
tm
*
)
char
*
asctime_r
(
const
tm
*
,
char
*
)
clock_t
clock
()
int
clock_getcpuclockid
(
pid_t
,
clockid_t
*
)
int
clock_getres
(
clockid_t
,
timespec
*
)
int
clock_gettime
(
clockid_t
,
timespec
*
)
int
clock_nanosleep
(
clockid_t
,
int
,
const
timespec
*
,
timespec
*
)
int
clock_settime
(
clockid_t
,
const
timespec
*
)
char
*
ctime
(
const
time_t
*
)
char
*
ctime_r
(
const
time_t
*
,
char
*
)
double
difftime
(
time_t
,
time_t
)
...
...
@@ -71,17 +37,6 @@ cdef extern from "time.h" nogil:
tm
*
localtime
(
const
time_t
*
)
tm
*
localtime_r
(
const
time_t
*
,
tm
*
)
time_t
mktime
(
tm
*
)
int
nanosleep
(
const
timespec
*
,
timespec
*
)
size_t
strftime
(
char
*
,
size_t
,
const
char
*
,
const
tm
*
)
char
*
strptime
(
const
char
*
,
const
char
*
,
tm
*
)
time_t
time
(
time_t
*
)
int
timer_create
(
clockid_t
,
sigevent
*
,
timer_t
*
)
int
timer_delete
(
timer_t
)
int
timer_gettime
(
timer_t
,
itimerspec
*
)
int
timer_getoverrun
(
timer_t
)
int
timer_settime
(
timer_t
,
int
,
const
itimerspec
*
,
itimerspec
*
)
void
tzset
()
int
daylight
long
timezone
char
*
tzname
[
2
]
size_t
wcsftime
(
wchar_t
*
str
,
size_t
cnt
,
const
wchar_t
*
fmt
,
tm
*
time
)
char
*
strptime
(
const
char
*
,
const
char
*
,
tm
*
)
# POSIX not stdC
Cython/Includes/posix/time.pxd
View file @
839d119c
# http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html
from
posix.types
cimport
suseconds_t
,
time_t
from
posix.types
cimport
suseconds_t
,
time_t
,
clockid_t
,
timer_t
from
posix.signal
cimport
sigevent
cdef
extern
from
"sys/time.h"
nogil
:
enum
:
CLOCK_PROCESS_CPUTIME_ID
enum
:
CLOCK_THREAD_CPUTIME_ID
enum
:
CLOCK_REALTIME
enum
:
TIMER_ABSTIME
enum
:
CLOCK_MONOTONIC
# FreeBSD-specific clocks
enum
:
CLOCK_UPTIME
enum
:
CLOCK_UPTIME_PRECISE
enum
:
CLOCK_UPTIME_FAST
enum
:
CLOCK_REALTIME_PRECISE
enum
:
CLOCK_REALTIME_FAST
enum
:
CLOCK_MONOTONIC_PRECISE
enum
:
CLOCK_MONOTONIC_FAST
enum
:
CLOCK_SECOND
# Linux-specific clocks
enum
:
CLOCK_PROCESS_CPUTIME_ID
enum
:
CLOCK_THREAD_CPUTIME_ID
enum
:
CLOCK_MONOTONIC_RAW
enum
:
CLOCK_REALTIME_COARSE
enum
:
CLOCK_MONOTONIC_COARSE
enum
:
CLOCK_BOOTTIME
enum
:
CLOCK_REALTIME_ALARM
enum
:
CLOCK_BOOTTIME_ALARM
enum
:
ITIMER_REAL
enum
:
ITIMER_VIRTUAL
...
...
@@ -16,10 +43,32 @@ cdef extern from "sys/time.h" nogil:
time_t
tv_sec
suseconds_t
tv_usec
cdef
struct
timespec
:
time_t
tv_sec
long
tv_nsec
cdef
struct
itimerval
:
timeval
it_interval
timeval
it_value
cdef
struct
itimerspec
:
timespec
it_interval
timespec
it_value
int
nanosleep
(
const
timespec
*
,
timespec
*
)
int
getitimer
(
int
,
itimerval
*
)
int
gettimeofday
(
timeval
*
tp
,
timezone
*
tzp
)
int
setitimer
(
int
,
const
itimerval
*
,
itimerval
*
)
int
clock_getcpuclockid
(
pid_t
,
clockid_t
*
)
int
clock_getres
(
clockid_t
,
timespec
*
)
int
clock_gettime
(
clockid_t
,
timespec
*
)
int
clock_nanosleep
(
clockid_t
,
int
,
const
timespec
*
,
timespec
*
)
int
clock_settime
(
clockid_t
,
const
timespec
*
)
int
timer_create
(
clockid_t
,
sigevent
*
,
timer_t
*
)
int
timer_delete
(
timer_t
)
int
timer_gettime
(
timer_t
,
itimerspec
*
)
int
timer_getoverrun
(
timer_t
)
int
timer_settime
(
timer_t
,
int
,
const
itimerspec
*
,
itimerspec
*
)
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