File: stimemac.c

package info (click to toggle)
audacity 1.2.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 22,600 kB
  • ctags: 20,360
  • sloc: ansic: 139,525; cpp: 55,197; sh: 24,963; lisp: 3,772; makefile: 1,679; python: 272
file content (48 lines) | stat: -rwxr-xr-x 470 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* stimemac.c -- portable timer implementation for macOS */



#include <Events.h>



#include "stime.h"



long gSTimeStartTime = TickCount();

int gSTimeResolution = 1000;



void stime_start(int resolution)

{

  gSTimeStartTime = TickCount();

  gSTimeResolution = resolution;

}



unsigned long stime_get()

{

  long elapsed = (TickCount() - gSTimeStartTime);

  

  double e2 = (elapsed / 60.0) * gSTimeResolution;

  

  return (unsigned long)(e2 + 0.5);

}