A question about time
Grant Edwards
grante at visi.com
Thu Jun 9 17:30:29 EDT 2005
On 2005-06-09, Grant Edwards <grante at visi.com> wrote:
> On 2005-06-09, Jan Danielsson <jan.danielsson at gmail.com> wrote:
>
>> In C, I would do this:
>>
>> server.invalidUntil = time(NULL) + 5*60; // five minute delay
>
> In Python, I would do this:
>
> server.invalidUntil = time.time() + 5*60 # five minute delay
>
>> ..and the check:
>>
>> if(time(NULL) > server.invalidUtil)
>> {
>> // use server
>> }
>
> if time() > server.invalidUntil:
> # user server
Um, that should have been
if time.time() > server.invalidUntil:
# use server
>> So the whole thing very simple...
>
> Yup.
Not quite simple enough that I could get it right the first time.
--
Grant Edwards grante Yow! I need to discuss
at BUY-BACK PROVISIONS
visi.com with at least six studio
SLEAZEBALLS!!
More information about the Python-list
mailing list