MathGroup Archive 2005

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

Search the Archive

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


Hi,

and a global variable that is set when you define 
the function
does not help
$time = AbsoluteTime[]
useless[] := AbsoluteTime[] - $time

Table[Pause[1]; useless[], {4}]

??

Regards

  Jens

"heycarnut" <heycarnut at gmail.com> schrieb im 
Newsbeitrag news:dj2662$b76$1 at smc.vnet.net...
| 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: Help with a function to return the 'age' of itself
  • Next by Date: Re: NestList
  • Previous by thread: Re: Help with a function to return the 'age' of itself
  • Next by thread: Bug with Limit, Series and ProductLog ?