~ubuntu-branches/ubuntu/raring/python-scipy/raring-proposed

« back to all changes in this revision

Viewing changes to Lib/xplt/src/play/win/timew.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-07 14:12:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070107141212-mm0ebkh5b37hcpzn
* Remove build dependency on python-numpy-dev.
* python-scipy: Depend on python-numpy instead of python-numpy-dev.
* Package builds on other archs than i386. Closes: #402783.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * timew.c -- $Id: timew.c,v 1.1 2003/03/08 15:26:49 travo Exp $
3
 
 * p_wall_secs for MS Windows
4
 
 *
5
 
 * Copyright (c) 1999.  See accompanying LEGAL file for details.
6
 
 */
7
 
 
8
 
#include "play.h"
9
 
 
10
 
/* GetTickCount in kernel32.lib */
11
 
#include <windows.h>
12
 
 
13
 
static int p_wall_init = 0;
14
 
 
15
 
static double p_wall_0 = 0.0;
16
 
static DWORD p_wall_1 = 0;
17
 
double
18
 
p_wall_secs(void)
19
 
{
20
 
  DWORD wall = GetTickCount();
21
 
  if (!p_wall_init) {
22
 
    p_wall_1 = wall;
23
 
    p_wall_init = 1;
24
 
  } else if (wall < p_wall_1) {
25
 
    p_wall_0 += 1.e-3*((~(DWORD)0) - p_wall_1);
26
 
    p_wall_0 += 1.e-3;
27
 
    p_wall_1 = 0;
28
 
  }
29
 
  p_wall_0 += 1.e-3*(wall-p_wall_1);
30
 
  p_wall_1 = wall;
31
 
  return p_wall_0;
32
 
}