Skip to content

Timer Methods#8

Open
samstewart wants to merge 3 commits into
katzgrau:masterfrom
samstewart:master
Open

Timer Methods#8
samstewart wants to merge 3 commits into
katzgrau:masterfrom
samstewart:master

Conversation

@samstewart

Copy link
Copy Markdown

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

katzgrau commented Jan 6, 2012

Copy link
Copy Markdown
Owner

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
Copy Markdown
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
Copy Markdown
Author

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

@onno-vos-dev

Copy link
Copy Markdown
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
Copy Markdown
Owner

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

@onno-vos-dev

Copy link
Copy Markdown
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