A question about time

Grant Edwards grante at visi.com
Thu Jun 9 23:13:51 CEST 2005


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

> So the whole thing very simple...

Yup.

-- 
Grant Edwards                   grante             Yow!  Look!! Karl Malden!
                                  at               
                               visi.com            



More information about the Python-list mailing list