Skip to content

Commit

Permalink
ffi(sdk): fix relays.py example
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Sep 2, 2024
1 parent 5edd944 commit 8a924b4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bindings/nostr-sdk-ffi/bindings-python/examples/relays.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import asyncio

from nostr_sdk import Client
import time


async def main():
client = Client(None)
client = Client()

await client.add_relay("wss://relay.damus.io")
await client.add_relay("wss://nostr.wine")
Expand All @@ -25,8 +24,10 @@ async def main():
print(f" Bytes sent: {stats.bytes_sent()}")
print(f" Bytes received: {stats.bytes_received()}")
print(f" Connected at: {stats.connected_at().to_human_datetime()}")
if await stats.latency() is not None:
print(f" Latency: {stats.latency().total_seconds() * 1000} ms")

latency = await stats.latency()
if latency is not None:
print(f" Latency: {latency.total_seconds() * 1000} ms")

print("###########################################")

Expand Down

0 comments on commit 8a924b4

Please sign in to comment.