Question: If I use `from time import time`, the Python 2.7.3 does not recognize `time.sleep(60)`. But if I use `import time`, then Python does not recognize `t=time()`. Why does this happen? Is there any way I can use `time()` and `time.sleep(x)` in the same program?

```
from time import time
#import time

intervalInMinute = 1
t = time()
while 1:
    time.sleep(60)

```

The kind of error I get is:

> 
> Traceback (most recent call last): File "myProg.py", line 9, in
>  
>  time.sleep(60) AttributeError: 'builtin\_function\_or\_method' object has no attribute 'sleep'
> 
> 
>

Answer: 
You need to decide what you want the name `time` to refer to, the module or the function called `time` in the module. You can write:

```
>>> from time import time, sleep
>>> time()
1347806075.148084
>>> sleep(3)
>>>

```

or

```
>>> import time 
>>> time.time()
1347806085.739065
>>> time.sleep(2)
>>>

```
`from time import time` imports the method `time()` from the module `time`. `import time`, on the other hand, imports the module `time`. `import time` and use `time.time()` instead of `time()`.