in reply to Re^2: A value that stays a value (for some time)
in thread A value that stays a value (for some time)

I'm unable to see how you can choose a stateless value which is guaranteed to not change for a finite period of time.

Since the number is stateless, it must depend on some external reference (eg. a timet).  However, you want the value to change, there's no way to avoid getting the value at some arbitrary number of seconds N prior to the number changing, for some N less than the duration you're interested in (here 600 seconds).  So unless I've misunderstood your requirements, I don't see how you what you're looking for is possible.

Now, if you're willing to accept numbers which are the same for a 10-minute period, just use:

my $value = int(time / 600);

But, of course, you still have the problem of having the value change very soon after you choose it.


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^4: A value that stays a value (for some time)
by freakingwildchild (Scribe) on Jun 18, 2006 at 16:07 UTC
    That's what I currently got; divided by the seconds but want it to be valid for the time it started without writing something to the server; it would be related only to time and the tables I attach to those times.