Mercurial > urweb
comparison lib/js/urweb.js @ 1685:225b87d4a7df
Basis.toMilliseconds and diffInMilliseconds, based on a patch from Gergely Buday
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 04 Feb 2012 11:01:06 -0500 |
parents | e8a84494d2c0 |
children | ea292bf9431f |
comparison
equal
deleted
inserted
replaced
1684:9dd8d47c3e58 | 1685:225b87d4a7df |
---|---|
130 | 130 |
131 function diffInSeconds(tm1, tm2) { | 131 function diffInSeconds(tm1, tm2) { |
132 return Math.round((tm2 - tm1) / 1000000); | 132 return Math.round((tm2 - tm1) / 1000000); |
133 } | 133 } |
134 | 134 |
135 function diffInMilliseconds(tm1, tm2) { | |
136 return Math.round((tm2 - tm1) / 1000); | |
137 } | |
138 | |
135 function toSeconds(tm) { | 139 function toSeconds(tm) { |
136 return Math.round(tm / 1000000); | 140 return Math.round(tm / 1000000); |
141 } | |
142 | |
143 function toMilliseconds(tm) { | |
144 return Math.round(tm / 1000); | |
137 } | 145 } |
138 | 146 |
139 function addSeconds(tm, n) { | 147 function addSeconds(tm, n) { |
140 return tm + n * 1000000; | 148 return tm + n * 1000000; |
141 } | 149 } |