MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Help with a function to return the 'age' of itself

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61392] Help with a function to return the 'age' of itself
  • From: "heycarnut" <heycarnut at gmail.com>
  • Date: Tue, 18 Oct 2005 02:44:33 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I'm trying to create a function, that when instantiated, keeps a 'copy'
of say the current absolute time, but when the instance is called, it
returns the delta between this 'copy' of the time and the current
absolute time. I have done this:


In[47]:= tt:=Hold[AbsoluteTime[]]-AbsoluteTime[];
         y=tt;
         N[Release[y]]
         Pause[10]
         N[Release[y]]


Out[49]=0.

Out[51]=10.

But I don't want to have to do an explicit release, i'd like to just be
able to evaluate y, in this case, and get the current value.
Help?

Thanks in advance,
Rob


  • Prev by Date: Re: (a/b)^2 when a/b is replaced by e won't yield e^2
  • Next by Date: Re: Use strings in Mathematica, like in C?
  • Previous by thread: Re: Matrices and Conditional Statements
  • Next by thread: Re: Help with a function to return the 'age' of itself