MCPcopy
hub / github.com/xpzouying/xiaohongshu-mcp / sleepRandom

Function sleepRandom

xiaohongshu/feed_detail.go:329–336  ·  view source on GitHub ↗

========== 工具函数 ==========

(minMs, maxMs int)

Source from the content-addressed store, hash-verified

327// ========== 工具函数 ==========
328
329func sleepRandom(minMs, maxMs int) {
330 if maxMs <= minMs {
331 time.Sleep(time.Duration(minMs) * time.Millisecond)
332 return
333 }
334 delay := time.Duration(minMs+rand.Intn(maxMs-minMs)) * time.Millisecond
335 time.Sleep(delay)
336}
337
338func getScrollInterval(speed string) time.Duration {
339 switch speed {

Callers 7

loadMethod · 0.85
checkCompleteMethod · 0.85
clickButtonsWithRetryMethod · 0.85
performScrollMethod · 0.85
humanScrollFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected