Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-ide
Commits
90ddfe7a
Commit
90ddfe7a
authored
Mar 22, 2005
by
John van Groningen
Browse files
OS dependent code for the time profiler on windows
parent
08d7f242
Changes
2
Show whitespace changes
Inline
Side-by-side
TimeProfile/Windows/time_profile_os_dependent.dcl
0 → 100644
View file @
90ddfe7a
definition
module
time_profile_os_dependent
PCorMac
pc
mac
:==
pc
clock_speed_and_profile_overhead
::
(!
Int
,!
Real
,!
Real
);
get_compute_time_function
::
!*
File
->
(!(
Int
,
Int
,
Int
)
->
Real
,!*
File
)
TimeProfile/Windows/time_profile_os_dependent.icl
0 → 100644
View file @
90ddfe7a
implementation
module
time_profile_os_dependent
import
StdEnv
import
code
from
"cpuspeed.obj"
PCorMac
pc
mac
:==
pc
define_fltused
::
!
Bool
->
Bool
define_fltused
n
=
code {
.export
_fltused
:
_fltused
pop_b
0
}
measure_clock_speed_and_profile_overhead
::
(!
Int
,!
Real
,!
Real
)
measure_clock_speed_and_profile_overhead
=
code {
ccall
measure_clock_speed_and_profile_overhead
":IRR"
}
clock_speed_and_profile_overhead
::
(!
Int
,!
Real
,!
Real
)
clock_speed_and_profile_overhead
|
define_fltused
True
=:
measure_clock_speed_and_profile_overhead
get_compute_time_function
::
!*
File
->
(!(
Int
,
Int
,
Int
)
->
Real
,!*
File
)
get_compute_time_function
file
#
(_,
clock_speed
,
overhead
)
=
clock_speed_and_profile_overhead
=
(
compute_time_x86
(
clock_speed
*
1.0E6
)
overhead
,
file
)
TwoPower32Real
:==
4294967296.0
compute_time_x86
::
a
.
Real
->
.((
b
,.
Int
,
c
)
->
Real
)
|
toReal
a
&
toReal
b
&
toReal
c
;
compute_time_x86
processor_clock
profile_overhead
=
\
(
time_hi
,
time_lo
,
n_profiler_calls
)
->
(
toReal
time_hi
*
TwoPower32Real
+
(
if
(
time_lo
>=
0
)
(
toReal
time_lo
)
(
TwoPower32Real
+
toReal
time_lo
)))/
toReal
processor_clock
-
(
toReal
n_profiler_calls
*
profile_overhead
/
toReal
processor_clock
)
Write
Preview
Supports
Markdown
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