MCPcopy Create free account
hub / github.com/dashscope/dashscope-sdk-java / pace

Method pace

samples/QwenLiveQuickStart.java:153–156  ·  view source on GitHub ↗
(long started, long sentBytes)

Source from the content-addressed store, hash-verified

151 }
152
153 private static void pace(long started, long sentBytes) throws InterruptedException {
154 long remaining = sentBytes * 1000000000L / INPUT_BYTES_PER_SECOND - (System.nanoTime() - started);
155 if (remaining > 0) TimeUnit.NANOSECONDS.sleep(remaining);
156 }
157
158 private static void checkFailure(AtomicReference<Throwable> failure) {
159 Throwable cause = failure.get();

Callers 1

streamAudioMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected