import time; def mtime(start,end): process = end - start; h = int(process / 3600); process -= h * 3600; m = int(process / 60); process -= m * 60; s = process; print "time: %dh %dm %fs" % (h, m, s); def foo(): start = time.time(); for i in range(0,10000000): pass end = time.time(); mtime(start,end) foo()
Python
import math frame = 1 fps = 24 sec = math.floor(frame/fps) ms = frame % fps * (1.0/fps) print sec + ms
import datetime import os # ファイルパスを設定 path = "E:/Tool/Maya/test.mel" # 現在の日付を取得 now = datetime.date.today() # ファイルの最終更新日時を取得 mtime = datetime.date.fromtimestamp(int(os.path.getmtime(path))) # 経過日数の表示 print (now - mtime).days