demos: Print timestamp

This commit is contained in:
Jonas Ådahl 2023-02-23 14:04:00 +01:00 committed by Peter Hutterer
parent cad5bc81bb
commit e4f23f69fc
2 changed files with 8 additions and 1 deletions

View file

@ -44,6 +44,7 @@
#include <signal.h>
#include <string.h>
#include <stdarg.h>
#include <inttypes.h>
#include <linux/input-event-codes.h>
#if HAVE_LIBXKBCOMMON
@ -453,6 +454,7 @@ int main(int argc, char **argv)
uint64_t now = ei_now(ei);
uint64_t interval = ms2us(10); /* pretend events are 10ms apart */
colorprint("now: %" PRIu64 "\n", now);
if (have_ptr) {
colorprint("sending motion event\n");
ei_device_pointer_motion(ptr, -1, 1);

View file

@ -48,6 +48,7 @@
#include <string.h>
#include <sys/mman.h>
#include <linux/input.h>
#include <inttypes.h>
#if HAVE_LIBXKBCOMMON
#include <xkbcommon/xkbcommon.h>
@ -476,7 +477,10 @@ eis_demo_server_printf_handle_event(struct eis_demo_server *server,
}
break;
case EIS_EVENT_FRAME:
/* nothing to do, we're not fancy enough to accumulate events properly */
{
colorprint("frame timestamp: %" PRIu64 "\n",
eis_event_get_time(e));
}
break;
default:
abort();
@ -620,6 +624,7 @@ int main(int argc, char **argv)
struct eis_demo_client *democlient;
uint64_t now = eis_now(eis);
colorprint("now: %" PRIu64 "\n", now);
const int interval = ms2us(12); /* events are 12ms apart */
list_for_each(democlient, &server.clients, link) {