diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:35 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:35 -0800 |
commit | f721e3ac031f892af46f255a47d7f54a91317b30 (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /telephony/test1.c | |
parent | bae1bc39312d5019bd9a5b8d840a529213a69a17 (diff) | |
download | external_qemu-f721e3ac031f892af46f255a47d7f54a91317b30.zip external_qemu-f721e3ac031f892af46f255a47d7f54a91317b30.tar.gz external_qemu-f721e3ac031f892af46f255a47d7f54a91317b30.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'telephony/test1.c')
-rw-r--r-- | telephony/test1.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/telephony/test1.c b/telephony/test1.c deleted file mode 100644 index 52701b9..0000000 --- a/telephony/test1.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (C) 2007-2008 The Android Open Source Project -** -** This software is licensed under the terms of the GNU General Public -** License version 2, as published by the Free Software Foundation, and -** may be copied, distributed, and modified under those terms. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -*/ -#include "sysdeps.h" -#include <stdio.h> - -#define MAX_COUNTER 10 - -static int counter = 0; - -static void -timer_func( void* _timer ) -{ - SysTimer timer = _timer; - SysTime now = sys_time_ms(); - - ++counter; - printf( "tick %d/%d a %.2fs\n", counter, MAX_COUNTER, now/1000. ); - if (counter < MAX_COUNTER) - sys_timer_set( timer, now + 2000, timer_func, timer ); - else - sys_timer_destroy( timer ); -} - - -int main( void ) -{ - SysTimer timer; - - /* initialize event subsystem */ - sys_main_init(); - - /* create timer and register it */ - timer = sys_timer_create(); - sys_timer_set( timer, sys_time_ms() + 1000, timer_func, timer ); - - printf("entering event loop\n"); - sys_main_loop(); - printf("exiting event loop\n" ); - return 0; -} |