evdev_note_time_delay(struct evdev_device *device,
		      const struct input_event *ev)
{
	struct libinput *libinput = evdev_libinput_context(device);
	uint32_t tdelta;
	uint64_t eventtime = input_event_time(ev);

	/* if we have a current libinput_dispatch() snapshot, compare our
	 * event time with the one from the snapshot. If we have more than
	 * 10ms delay, complain about it. This catches delays in processing
	 * where there is no steady event flow and thus SYN_DROPPED may not
	 * get hit by the kernel despite us being too slow.
	 */
	if (libinput->dispatch_time == 0 ||
	    eventtime > libinput->dispatch_time)
		return;

	tdelta = us2ms(libinput->dispatch_time - eventtime);
	if (tdelta > 20) {
		evdev_log_bug_client_ratelimit(device,
					       &device->delay_warning_limit,
					       "event processing lagging behind by %dms, your system is too slow\n",
					       tdelta);
	}
}
evdev_note_time_delay(struct evdev_device *device,
		      const struct input_event *ev)
{
	struct libinput *libinput = evdev_libinput_context(device);
	uint32_t tdelta;
	uint64_t eventtime = input_event_time(ev);

	 
	if (libinput->dispatch_time == 0 ||
	    eventtime > libinput->dispatch_time)
		return;

	tdelta = us2ms(libinput->dispatch_time - eventtime);
	if (tdelta > 20) {
		evdev_log_bug_client_ratelimit(device,
					       &device->delay_warning_limit,
					       "event processing lagging behind by %dms, your system is too slow\n",
					       tdelta);
	}
}