From 6c512b8ebcf07f655dc2d76b7d1d52158c52450f Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 2 Jan 2007 20:40:49 +0000 Subject: Olaf's first code for windows svn path=/trunk/externals/io/hidio/; revision=7126 --- hidio_darwin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hidio_darwin.c') diff --git a/hidio_darwin.c b/hidio_darwin.c index a48885e..ff99bd9 100644 --- a/hidio_darwin.c +++ b/hidio_darwin.c @@ -283,7 +283,6 @@ static t_float get_type_name_instance(t_symbol *type, t_symbol *name, /* DARWIN-SPECIFIC SUPPORT FUNCTIONS */ /* ============================================================================== */ -/* // temp hack for measuring latency double calculate_event_latency( uint64_t endTime, uint64_t startTime ) { @@ -297,7 +296,7 @@ double calculate_event_latency( uint64_t endTime, uint64_t startTime ) if( 0 == err ) { //convert to seconds (multiply by 1e-6 to get miliseconds) - conversion = 1e-6 * (double) info.numer / (double) info.denom; + conversion = 1e-3 * (double) info.numer / (double) info.denom; } } return conversion * (double) difference; @@ -677,8 +676,9 @@ void hidio_get_events(t_hidio *x) // debug_post(LOG_DEBUG,"output this: %s %s %d prev %d",current_element->type->s_name, // current_element->name->s_name, current_element->value, // current_element->previous_value); -// debug_post(LOG_DEBUG,"timestamp: %u %u", event.timestamp.hi, event.timestamp.lo); timestamp = * (uint64_t *) &(event.timestamp); + difference = calculate_event_latency(timestamp,0); + debug_post(LOG_DEBUG,"timestamp: %llu %llu", timestamp, difference); now = mach_absolute_time(); /* // temp hack for measuring latency -- cgit v1.2.1