mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2025-12-28 09:40:07 +01:00
demos: Print timestamp
This commit is contained in:
parent
cad5bc81bb
commit
e4f23f69fc
2 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue