修复歌词原文和译文交错排列时会出现不对应的问题
This commit is contained in:
parent
452db2f7d2
commit
f92ddb245b
8 changed files with 183 additions and 40 deletions
25
lts_test.go
Normal file
25
lts_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func BenchmarkSRTContent_String(b *testing.B) {
|
||||
srt := SRTContent{
|
||||
Index: 10,
|
||||
Start: 100,
|
||||
End: 200,
|
||||
Text: "言语 不起作用,想看到 具体行动",
|
||||
}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = srt.String()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLrc2Srt(b *testing.B) {
|
||||
id := "28891491"
|
||||
lyric, lyricT := Get163Lyric(id)
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, _ = Lrc2Srt(lyric), Lrc2Srt(lyricT)
|
||||
}
|
||||
}
|
Reference in a new issue