~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to src/ptimer.c

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2005-10-13 16:59:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051013165903-3e12j4gn6znkhmdb
Tags: 1.10.2-1
new upstream release which fixes a NTLM Buffer Overflow Vulnerability

Show diffs side-by-side

added added

removed removed

Lines of Context:
388
388
}
389
389
 
390
390
/* Reset timer PT.  This establishes the starting point from which
391
 
   ptimer_read() will return the number of elapsed milliseconds.
 
391
   ptimer_measure() will return the number of elapsed milliseconds.
392
392
   It is allowed to reset a previously used timer.  */
393
393
 
394
394
void
400
400
  pt->elapsed_pre_start = 0;
401
401
}
402
402
 
403
 
/* Measure the elapsed time since timer creation/reset and return it
404
 
   to the caller.  The value remains stored for further reads by
405
 
   ptimer_read.
406
 
 
407
 
   This function causes the timer to call gettimeofday (or time(),
408
 
   etc.) to update its idea of current time.  To get the elapsed
409
 
   interval in milliseconds, use ptimer_read.
 
403
/* Measure the elapsed time since timer creation/reset.  This causes
 
404
   the timer to internally call clock_gettime (or gettimeofday, etc.) 
 
405
   to update its idea of current time.  The time in milliseconds is
 
406
   returned, but is also stored for later access through
 
407
   ptimer_read().
410
408
 
411
409
   This function handles clock skew, i.e. time that moves backwards is
412
410
   ignored.  */
447
445
  return elapsed;
448
446
}
449
447
 
450
 
/* Return the elapsed time in milliseconds between the last call to
451
 
   ptimer_reset and the last call to ptimer_update.  */
 
448
/* Return the most recent elapsed time in milliseconds, as measured
 
449
   with ptimer_measure.  If ptimer_measure has not yet been called
 
450
   since the timer was created or reset, this returns 0.  */
452
451
 
453
452
double
454
453
ptimer_read (const struct ptimer *pt)