Statistics
| Branch: | Revision:

streamers / dbg.c @ 7f591208

History | View | Annotate | Download (474 Bytes)

1
/*
2
 *  Copyright (c) 2010 Luca Abeni
3
 *  Copyright (c) 2010 Csaba Kiraly
4
 *
5
 *  This is free software; see gpl-3.0.txt
6
 */
7
#include <sys/time.h>
8
#include <stdio.h>
9
#include <stdarg.h>
10

    
11
static struct timeval tnow;
12

    
13
int dtprintf2(const char *format, ...)
14
{
15
  va_list ap;
16
  int ret;
17
  
18
  gettimeofday(&tnow, NULL);
19
  fprintf(stderr, "%ld.%03ld ", tnow.tv_sec, tnow.tv_usec/100);
20

    
21
  va_start (ap, format);
22
  ret = vfprintf(stderr, format, ap);
23
  va_end (ap);
24
  
25
  return ret;
26
}