python > datetime > msecを取得する > msec = int(round(time.time() * 1000)) % 1000


動作確認
CentOS 6.5

現在時刻のmsecを取得したい。

参考
http://stackoverflow.com/questions/5998245/get-current-time-in-milliseconds-in-python

151202a.py
import time

for loop in range(0,3):
    msec = int(round(time.time() * 1000)) % 1000
    print msec
    time.sleep(0.1)
結果
[toLearn]$ python 151202a.py 
283
384
484

だいたい100msecごとにmsecの値が表示できている。