javasrcipt 计算时间差到毫秒。

1
00:00:13,170 --> 00:00:16,560 //这是字幕里的文件
wheeler introducing
2
00:00:16,560 --> 00:00:29,180
results survival from 7-11 only on ECG
hasn't decided whether he goes in

想计算每条字幕显示的时间

 var t1 = "00:00:13,170";
var t2 = "00:00:16,560";
var间隔毫秒数 = parseInt(t2.split(",")[0].split(",")[0]) * 3600000 +
parseInt(t2.split(",")[0].split(",")[1]) * 60000 +
parseInt(t2.split(",")[0].split(",")[2]) * 1000 + 
parseInt(t2.split(",")[1]) -
parseInt(t1.split(",")[0].split(",")[0]) * 3600000 +
parseInt(t1.split(",")[0].split(",")[1]) * 60000 +
parseInt(t1.split(",")[0].split(",")[2]) * 1000 + 
parseInt(t1.split(",")[1]);

转换成秒就除以1000

转换成时间戳的话更方便处理