Skip to main content
19 events
when toggle format what by license comment
Jan 14, 2017 at 13:40 comment added Mike Dunlavey @solti: Meta-question: What is the reason why you want to do these measurements? Is it because you want to find ways to reduce the execution time, or some other reason?
Jan 12, 2017 at 21:29 vote accept solti
Jan 12, 2017 at 21:00 comment added Robert Harvey I don't think your timer needs to know about your object either. Just start your timer, call whatever methods on your objects you wish to time, and stop the timer when the method returns.
Jan 12, 2017 at 20:56 comment added solti So did you meant something like this? ideone.com/SDrzRP
Jan 12, 2017 at 20:48 answer added Robert Harvey timeline score: 2
Jan 12, 2017 at 20:24 comment added solti @RobertHarvey When I say " this is my reason behind trying to create only one class" I actually meant "this is my reason behind trying to create only one object " sorry abt that
Jan 12, 2017 at 20:09 comment added Robert Harvey That's the correct reasoning.
Jan 12, 2017 at 20:07 comment added solti @RobertHarvey Hmmm I not really (about class and object). I want to create only one instance of the class rather then multiple because why create multiple instance if only one instance does the job (this is my reason behind trying to create only one class)
Jan 12, 2017 at 20:01 comment added Robert Harvey I think you're confusing classes with object instances; you should only have one measure_time class, but it's perfectly valid to use that one class to create several object instances in other classes.
Jan 12, 2017 at 19:59 comment added Robert Harvey The way you find an answer to your question is to first determine what "better" means to you. One you know that, I think the "proper" approach will become obvious.
Jan 12, 2017 at 19:23 comment added solti @RobertHarvey let me know if I am still not struggling to explain my question :p because it has happened to me before .. and I want to learn a proper approach to ask question.
Jan 12, 2017 at 19:21 comment added solti @RobertHarvey "So what I wanted was to define the measure_time class only once and use it across the class A, B and C." my concern is that I am defining measure_time class in each class A, B and C and wondering if that is right approach. I think defining class measure_time once and reusing it better approach. So I guess my question is how to do it in a way I only have to define class measure_time once and re-use it.
Jan 12, 2017 at 19:21 review Close votes
Feb 8, 2017 at 3:01
Jan 12, 2017 at 19:13 comment added Robert Harvey Better. So what is your actual question?
Jan 12, 2017 at 19:11 comment added solti @RobertHarvey I updated my question now .. thank you for the suggestion.
Jan 12, 2017 at 19:11 history edited solti CC BY-SA 3.0
added 87 characters in body
Jan 12, 2017 at 19:05 comment added Robert Harvey Questions that contain weasel words like "better" are unanswerable. We don't know what "better" means to you specifically.
Jan 12, 2017 at 19:03 history edited solti CC BY-SA 3.0
added 64 characters in body
Jan 12, 2017 at 18:57 history asked solti CC BY-SA 3.0