def formatedTime(ms):
if ms:<EOL><INDENT>s = ms / <NUM_LIT><EOL>m, s = divmod(s, <NUM_LIT>)<EOL>h, m = divmod(m, <NUM_LIT>)<EOL>d, h = divmod(h, <NUM_LIT>)<EOL>out = '<STR_LIT>'<EOL>if d:<EOL><INDENT>out += '<STR_LIT>' % d<EOL><DEDENT>if h:<EOL><INDENT>out += '<STR_LIT>' % h<EOL><DEDENT>if m:<EOL><INDENT>out += '<STR_LIT>' % m<EOL><DEDENT>if s:<EOL><INDENT>out += '<STR_LIT>' % s<EOL><DEDENT>return out[:-<NUM_LIT:1>]<EOL><DEDENT>return '<STR_LIT>'<EOL>
convert milliseconds in a human readable time

>>> formatedTime(60e3)
'1m'
>>> formatedTime(1000e3)
'16m 40s'
>>> formatedTime(200000123)
'2d 7h 33m 20.123s'