import asyncio
+import timeit
from mpdaio.client import MPDClient
async def run_cli():
cli = MPDClient()
- await cli.connect()
- current = await cli.currentsong()
- print(current)
- print(await cli.playlistinfo())
+ cli.mpd_timeout = 0.1
+ #await cli.connect()
+ #current = await cli.currentsong()
+ #print(current)
+
+ await cli.currentsong()
+ await cli.playlistinfo()
+ await cli.list('artist')
+ #print(await cli.playlistinfo())
await cli.close()
-asyncio.run(run_cli())
+if __name__ == '__main__':
+ asyncio.run(run_cli())
+ asyncio.run(run_cli())
+ #t = timeit.Timer('asyncio.run(run_cli())', globals=globals())
+ #print(t.autorange())
+ with asyncio.Runner() as runner:
+ runner.run(run_cli())
+ runner.run(run_cli())