Reputation: 3398
Is there a way to get the time an object was instantiated without having to store a timestamp date object in it to recall?
I'm using a class from a framework and I want a timestamp on when it was created without having to extend or create a wrapper for it just for a date object.
Upvotes: 1
Views: 107
Reputation: 7576
I wouldn't expect it to be recorded. What is important from a class perspective is how many references it has. No matter when it was created, once it has no references, it is garbage. When it was created is of no interest to the runtime.
Upvotes: 1