简述
之前介绍了libuv库在Windows环境下的编译https://blog.csdn.net/hubei_dxx/article/details/117768529
现在我们把编译的库用起来,使用工具VS2010
新建项目
在解决方案新建项目,选择win32控制台应用程序,名称这里用uv_timer,然后点击确定。把该项目右键设置为启动项。
代码编写
设置一个定时器,3秒后启动,之后每秒执行,执行5次后停止
#include "uv.h"
unsigned int g_tick;
unsigned int g_count = 5;
void time_cb(uv_timer_t* handle)
{
unsigned int now = GetTickCount()