50 QObject::connect(obj, SIGNAL(changed()), obj, SLOT(onChanged()));
55 auto start = std::chrono::steady_clock::now();
56 for (
int i = 0; i < count; i++)
58 QObject::disconnect(obj, SIGNAL(changed()), obj, SLOT(onChanged()));
60 QObject::connect(obj, SIGNAL(changed()), obj, SLOT(onChanged()));
62 auto end = std::chrono::steady_clock::now();
63 printf(
"disconnect/emit/connect %d times took %lf seconds.\n", count,
64 std::chrono::duration<double>(end -
start).count());
68 start = std::chrono::steady_clock::now();
69 for (
int i = 0; i < count; i++)
75 end = std::chrono::steady_clock::now();
76 printf(
"suppress/emit/enable %d times took %lf seconds.\n", count,
77 std::chrono::duration<double>(end -
start).count());