#!/usr/bin/python
# -*- coding:UTF-8 -*-
import time
"""
pause for 2 seconds and format the timestamp
"""
def pause(n):
for x in range(10):
print x
print time.strftime('%Y/%m/%d %H:%M:%S', time.localtime(time.time()))
time.sleep(n)
print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
pause(2)
'''
will cost some times to finish the loop
'''
转载于:https://www.cnblogs.com/TendToBigData/p/10501223.html