File: payload.py

package info (click to toggle)
python-engineio 4.12.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 944 kB
  • sloc: python: 10,594; makefile: 15; sh: 6
file content (20 lines) | stat: -rw-r--r-- 459 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import time
from engineio import packet, payload


def test():
    p = payload.Payload(
        packets=[packet.Packet(packet.MESSAGE, b'hello world')] * 10)
    start = time.time()
    count = 0
    while True:
        p = payload.Payload(encoded_payload=p.encode())
        count += 1
        if time.time() - start >= 5:
            break
    return count


if __name__ == '__main__':
    count = test()
    print('payload:', count, 'payloads processed.')