#๐Ÿ”’ time module

23 messages ยท Page 1 of 1 (latest)

finite prawn
#

just need some clarification on how the time function works

fallow bobcatBOT
#

@finite prawn

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

heavy lantern
#

name your variables something else than time

#

!d time.time

fallow bobcatBOT
#

time.time() โ†’ float```
Return the time in seconds since the [epoch](https://docs.python.org/3/library/time.html#epoch) as a floating point number. The handling of [leap seconds](https://en.wikipedia.org/wiki/Leap_second) is platform dependent. On Windows and most Unix systems, the leap seconds are not counted towards the time in seconds since the [epoch](https://docs.python.org/3/library/time.html#epoch). This is commonly referred to as [Unix time](https://en.wikipedia.org/wiki/Unix_time).

Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls.
finite prawn
#

if i make it x.time()

#

what is it doing to x

heavy lantern
#

what is x ?

finite prawn
#

this is the example

heavy lantern
#

ok , and ?

#

i am not sure i understand what you are trying to say

#

can you explain ?

finite prawn
#

i dont get what the time function is doing to the time variable

heavy lantern
#

time is a library
it has a function called time inside of it

it is just calling that function

finite prawn
#

oh im dumb

heavy lantern
#

if the library was named something like timeisnotreal , you would use the function as timeisnotreal.time()

finite prawn
#

yeah i understand

#

i think thats all i need to know

#

cheers

heavy lantern
#

๐Ÿฅ‚

fallow bobcatBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.