Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f7eac004
Commit
f7eac004
authored
Oct 16, 2008
by
Dries
Browse files
- Patch
#321337
by gpk: optmized timer_start() and timer_read() thanks to PHP5.
parent
f1fda0f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/bootstrap.inc
View file @
f7eac004
...
...
@@ -217,8 +217,7 @@
function
timer_start
(
$name
)
{
global
$timers
;
list
(
$usec
,
$sec
)
=
explode
(
' '
,
microtime
());
$timers
[
$name
][
'start'
]
=
(
float
)
$usec
+
(
float
)
$sec
;
$timers
[
$name
][
'start'
]
=
microtime
(
TRUE
);
$timers
[
$name
][
'count'
]
=
isset
(
$timers
[
$name
][
'count'
])
?
++
$timers
[
$name
][
'count'
]
:
1
;
}
...
...
@@ -234,8 +233,7 @@ function timer_read($name) {
global
$timers
;
if
(
isset
(
$timers
[
$name
][
'start'
]))
{
list
(
$usec
,
$sec
)
=
explode
(
' '
,
microtime
());
$stop
=
(
float
)
$usec
+
(
float
)
$sec
;
$stop
=
microtime
(
TRUE
);
$diff
=
round
((
$stop
-
$timers
[
$name
][
'start'
])
*
1000
,
2
);
if
(
isset
(
$timers
[
$name
][
'time'
]))
{
...
...
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