Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer Methods #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Timer Methods #8

wants to merge 3 commits into from

Conversation

samstewart
Copy link

Hi,
I added some simple timing methods and started work on a lightweight PHP profiler (KProfiler). Anyway, would love to make at least the timing methods available to everyone.

Keep up the good work!

Sam

@katzgrau
Copy link
Owner

katzgrau commented Jan 6, 2012

Cool, I like the addition of the timing functions, but I'd suggest perhaps storing the start time of a task in a hash table where the task name is the key?

Ie,

$this->_startTimes[$task] = $time

That way you can nest timings

Kenny Katzgrau
Web: http://codefury.net
Twitter: @kennyk
Skype: kenny.katzgrau

On Thursday, January 5, 2012 at 11:01 PM, Sam Stewart wrote:

Hi,
I added some simple timing methods and started work on a lightweight PHP profiler (KProfiler). Anyway, would love to make at least the timing methods available to everyone.

Keep up the good work!

Sam

You can merge this Pull Request by running:

git pull https://github.com/samstewart/KLogger master

Or you can view, comment on it, or merge it online at:

#8

-- Commit Summary --

  • Added KProfiler and added new timing methods to KLogger.php
  • [tweak] tabs to spaces to match coding guidelines

-- File Changes --

M .gitignore (10)
M example/example.php (17)
M src/KLogger.php (47)
A src/KProfiler.php (83)

-- Patch Links --

https://github.com/katzgrau/KLogger/pull/8.patch
https://github.com/katzgrau/KLogger/pull/8.diff


Reply to this email directly or view it on GitHub:
#8

@samstewart
Copy link
Author

Excellent point, I guess I assumed a sort of "stack based" call where every start call is matched with a finish call. However, there is a good chance a developer may start another timing call before finishing the last one.

I'll make the changes and push.

@samstewart
Copy link
Author

Alright, I added the array as you suggested. I cleaned up the example file a bit.

@onno-vos-dev
Copy link
Contributor

@katzgrau / @samstewart I know this is a very old PR but I do like this feature. Seeing as KLogger has evolved a lot since this PR was submitted, this needs to be reworked into the current version of KLogger.

@samstewart Up for the task or can someone else rework this?
@katzgrau Would you still like to have this feature? 👍

@katzgrau
Copy link
Owner

@onno-vos-dev I like the feature too — would be OK adding it

@onno-vos-dev
Copy link
Contributor

@katzgrau Unless @samstewart reports here in the next week or so, I'll try to get my hands dirty again on KLogger and implement this feature for the new version of KLogger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants