Mercurial > mplayer.hg
comparison TOOLS/realcodecs/drv4.c @ 35904:cef5275fc11f
Avoid usage of obsolete and BSD-specific "struct timezone".
author | diego |
---|---|
date | Sun, 17 Mar 2013 22:47:31 +0000 |
parents | 32725ca88fed |
children |
comparison
equal
deleted
inserted
replaced
35903:389d43c448b3 | 35904:cef5275fc11f |
---|---|
106 | 106 |
107 void _init(void) { | 107 void _init(void) { |
108 loadSyms(); | 108 loadSyms(); |
109 } | 109 } |
110 | 110 |
111 struct timezone tz; | |
112 struct timeval tv1, tv2; | 111 struct timeval tv1, tv2; |
113 | 112 |
114 void tic(void) { | 113 void tic(void) { |
115 gettimeofday(&tv1, &tz); | 114 gettimeofday(&tv1, NULL); |
116 } | 115 } |
117 | 116 |
118 void toc(void) { | 117 void toc(void) { |
119 long secs, usecs; | 118 long secs, usecs; |
120 gettimeofday(&tv2, &tz); | 119 gettimeofday(&tv2, NULL); |
121 secs=tv2.tv_sec-tv1.tv_sec; | 120 secs=tv2.tv_sec-tv1.tv_sec; |
122 usecs=tv2.tv_usec-tv1.tv_usec; | 121 usecs=tv2.tv_usec-tv1.tv_usec; |
123 if (usecs<0) { | 122 if (usecs<0) { |
124 usecs+=1000000; | 123 usecs+=1000000; |
125 --secs; | 124 --secs; |