Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alexbiehl-gc
GHC
Commits
15e576ec
Commit
15e576ec
authored
25 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-09-30 12:38:44 by sof]
removed prim_getClockTime
parent
b113320e
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/lib/std/cbits/getClockTime.c
+3
-52
3 additions, 52 deletions
ghc/lib/std/cbits/getClockTime.c
with
3 additions
and
52 deletions
ghc/lib/std/cbits/getClockTime.c
+
3
−
52
View file @
15e576ec
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
* $Id: getClockTime.c,v 1.
5
1999/09/
12
1
4
:3
3:56
sof Exp $
* $Id: getClockTime.c,v 1.
6
1999/09/
30
1
2
:3
8:44
sof Exp $
*
* getClockTime Runtime Support
*/
...
...
@@ -40,8 +40,8 @@ getClockTime(StgByteArray sec, StgByteArray nsec)
{
#if defined(_WIN32) && !defined(cygwin32_TARGET_OS)
/*
* time() as
is
implemented by cygwin (in B20.1) is
* not right, so stay away
(and
use time()
)
instead.
*
f
time() as implemented by cygwin (in B20.1) is
* not right, so stay away
&
use time()
there
instead.
*/
struct
timeb
t
;
...
...
@@ -86,52 +86,3 @@ getClockTime(StgByteArray sec, StgByteArray nsec)
#error "getClockTime: don't know how to get at the clock's time"
#endif
}
StgInt
prim_getClockTime
(
StgByteArray
sec
,
StgByteArray
nsec
)
{
#if defined(_WIN32) && !defined(cygwin32_TARGET_OS)
/* see getClockTime() comment re: ftime() & cygwin */
struct
timeb
t
;
_ftime
(
&
t
);
((
unsigned
long
int
*
)
sec
)[
0
]
=
t
.
time
;
((
unsigned
long
int
*
)
nsec
)[
0
]
=
t
.
millitm
*
1000
;
return
0
;
#elif defined(HAVE_TIME_H)
time_t
t
;
if
((
t
=
time
(
NULL
))
==
(
time_t
)
-
1
)
{
cvtErrno
();
stdErrno
();
return
-
1
;
}
((
StgInt64
*
)
sec
)[
0
]
=
t
;
((
StgInt64
*
)
nsec
)[
0
]
=
0
;
return
0
;
#elif defined(HAVE_GETCLOCK)
struct
timespec
tp
;
if
(
getclock
(
TIMEOFDAY
,
&
tp
)
!=
0
)
{
cvtErrno
();
stdErrno
();
return
-
1
;
}
((
StgInt64
*
)
sec
)[
0
]
=
tp
.
tv_sec
;
((
StgInt64
*
)
nsec
)[
0
]
=
tp
.
tv_nsec
;
return
0
;
#elif defined(HAVE_GETTIMEOFDAY)
struct
timeval
tp
;
if
(
gettimeofday
(
&
tp
,
NULL
)
!=
0
)
{
cvtErrno
();
stdErrno
();
return
-
1
;
}
((
StgInt64
*
)
sec
)[
0
]
=
tp
.
tv_sec
;
((
StgInt64
*
)
nsec
)[
0
]
=
tp
.
tv_usec
*
1000
;
return
0
;
#else
#error "getClockTime: don't know how to get at the clock's time"
#endif
}
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