Spaces:
Running
Running
Download dengtaishan-src/tools/perf.py from Ethscriptions/mx: direct link, hf CLI and curl.
- Browser
- Download file 592 Bytes
-
https://huggingface.co/spaces/Ethscriptions/mx/resolve/main/dengtaishan-src/tools/perf.py
- Command line
-
hf download hf://spaces/Ethscriptions/mx/dengtaishan-src/tools/perf.py
-
curl -L -o perf.py https://huggingface.co/spaces/Ethscriptions/mx/resolve/main/dengtaishan-src/tools/perf.py
592 Bytes
| import asyncio, sys | |
| from playwright.async_api import async_playwright | |
| BASE = "http://localhost:5173/preview/production/1b822e06-b78d-4352-884d-1f8fddabf546/" | |
| async def main(): | |
| async with async_playwright() as p: | |
| b = await p.chromium.launch() | |
| pg = await b.new_page() | |
| for ts in sys.argv[2:]: | |
| await pg.goto(f"{BASE}?still={ts}&o={sys.argv[1]}&w=1920") | |
| await pg.wait_for_function("document.title==='ready'", timeout=300000) | |
| print(ts, round(await pg.evaluate("window.MS"), 1), "ms/frame") | |
| await b.close() | |
| asyncio.run(main()) | |