100+ results for '_SC_CLK_TCK'

Not the results you expected?

OSD_Chronometer.cxx (https://github.com/AsherBond/MondocosmOS.git) C++ · 272 lines

62 {

63 #if defined(LIN) || defined(linux) || defined(__FreeBSD__)

64 static const long aCLK_TCK = sysconf(_SC_CLK_TCK);

65 #else

66 static const long aCLK_TCK = CLK_TCK;

sysconf.h (http://microsea.googlecode.com/svn/trunk/) C Header · 143 lines

3 #define _SC_ARG_MAX 0

4 #define _SC_CHILD_MAX 1

5 #define _SC_CLK_TCK 2

6 #define _SC_NGROUPS_MAX 3

7 #define _SC_OPEN_MAX 4

main_tang.cpp (https://github.com/rrnewton/PochoirMods.git) C++ · 245 lines

223

224 void MAIN_startClock( MAIN_Time* time ) {

225 time->timeScale = 1.0 / sysconf( _SC_CLK_TCK );

226 time->tickStart = times( &(time->timeStart) );

227 }

process_cpu_clocks.hpp (https://github.com/BlitzMaxModules/bah.mod.git) C++ Header · 331 lines

32 if (!factor)

33 {

34 if ((factor = ::sysconf(_SC_CLK_TCK)) <= 0)

35 factor = -1;

36 else

init.c (https://bitbucket.org/cdcs/leon-rtems.git) C · 88 lines

44 #endif

45

46 sc = sysconf( _SC_CLK_TCK );

47 printf( "sysconf - _SC_CLK_TCK=%ld\n", sc );

main.c (https://github.com/osdnk/sysopy.git) C · 266 lines

18

19 double calculate_time(clock_t start, clock_t end) {

20 return (double) (end - start) / sysconf(_SC_CLK_TCK);

21 }

22

gmcpubar.c (https://github.com/vmj/gmbar.git) C · 360 lines

123

124 /* Clock ticks per second (per CPU) */

125 total = sysconf(_SC_CLK_TCK);

126

127 /* Number of CPUs */

runtime.c (https://github.com/kfl/mosml.git) C · 326 lines

271 struct tms buffer;

272

273 long persec = sysconf(_SC_CLK_TCK);

274 times(&buffer);

275 gc_time.tv_sec -= buffer.tms_utime / persec;

305 struct tms buffer;

306

307 long persec = sysconf(_SC_CLK_TCK);

308 times(&buffer);

309 gc_time.tv_sec += buffer.tms_utime / persec;

process_cpu_clocks.hpp (https://github.com/Tencent/mars.git) C++ Header · 354 lines

29 if ( !factor )

30 {

31 if ( (factor = ::sysconf( _SC_CLK_TCK )) <= 0 )

32 factor = -1;

33 else

stopwatch.cpp (https://github.com/aptana/Jaxer.git) C++ · 265 lines

24

25 #ifdef R__UNIX

26 if (!gTicks) gTicks = (clock_t)sysconf(_SC_CLK_TCK);

27 #endif

28 fState = kUndefined;

chrono.cpp (https://github.com/ftk/niceamx.git) C++ · 289 lines

175 if ( !factor )

176 {

177 if ((factor = ::sysconf( _SC_CLK_TCK )) <= 0)

178 factor = -1;

179 else

Timer.cc (https://github.com/casacore/casacore.git) C++ · 345 lines

87 tms usage1; // current tms structure

88 real1 = times (&usage1);

89 return ((double) (real1 - real0)) / ((double) sysconf(_SC_CLK_TCK));

90 # endif

91 #else

128 times (&usage1);

129 return ((double) (usage1.tms_utime - usage0.tms_utime))

130 / ((double) sysconf(_SC_CLK_TCK));

131 # endif

132 #else

158 times (&usage1);

159 return ((double) (usage1.tms_stime - usage0.tms_stime))

160 / ((double) sysconf(_SC_CLK_TCK));

161 # endif

162 #else

index.c (https://github.com/peper/pizza.git) C · 189 lines

31 // first creates a full trie T

32 #ifdef INDEXREPORT

33 ticks= sysconf(_SC_CLK_TCK);

34 times(&time); t1 = time.tms_utime;

35 printf(" Building LZTrie...\n"); fflush(stdout);

fpm_scoreboard.c (https://github.com/Doap/php-src.git) C · 328 lines

29

30 #ifdef HAVE_TIMES

31 #if (defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK))

32 fpm_scoreboard_tick = sysconf(_SC_CLK_TCK);

33 #else /* _SC_CLK_TCK */

34 #ifdef HZ

35 fpm_scoreboard_tick = HZ;

37 fpm_scoreboard_tick = 100;

38 #endif /* HZ */

39 #endif /* _SC_CLK_TCK */

40 zlog(ZLOG_DEBUG, "got clock tick '%.0f'", fpm_scoreboard_tick);

41 #endif /* HAVE_TIMES */

hrt_utils.c (https://github.com/alibaba/AliSQL.git) C · 228 lines

145 static long clock_ticks = 0;

146 if (clock_ticks == 0) {

147 clock_ticks = sysconf(_SC_CLK_TCK);

148 assert (clock_ticks > 0);

149 }

167 static long clock_ticks = 0;

168 if (clock_ticks == 0) {

169 clock_ticks = sysconf(_SC_CLK_TCK);

170 assert (clock_ticks > 0);

171 }

csystem.c (https://github.com/mbrock/bigloo-llvm.git) C · 418 lines

291 obj_t res;

292

293 if( !ctick ) ctick = sysconf( _SC_CLK_TCK );

294

295 t1 = times( &buf1 );

ticks.c (https://gitlab.com/d.esterman/ba-phmf) C · 93 lines

89 ticksPerSec(void)

90 {

91 return (int)sysconf(_SC_CLK_TCK);

92 }

93

Timer.cpp (https://github.com/sofian/drone.git) C++ · 121 lines

66 times(&current);

67

68 float norm = (float)sysconf(_SC_CLK_TCK);

69 return(((float)current.tms_utime)/norm);

70 #endif

uttTime.cpp (https://github.com/ALTIBASE/altibase.git) C++ · 503 lines

142 m_microseconds_user +=

143 (SLong)( end_time_tick.tms_utime - start_time_tick.tms_utime )

144 * 1000000 / /*BUGBUG_NT*/(SLong)/*sysconf*/idlOS::sysconf/*BUGBUG_NT*/( _SC_CLK_TCK );

145 /* Compute system clock time */

146 m_microseconds_system +=

147 (SLong)( end_time_tick.tms_stime - start_time_tick.tms_stime )

148 * 1000000 / /*BUGBUG_NT*/(SLong)/*sysconf*/idlOS::sysconf/*BUGBUG_NT*/( _SC_CLK_TCK );

149 #else

150 m_microseconds_wallclock += (ULong)v_timeval.tv_sec * 1000000 + (ULong)v_timeval.tv_usec;

153 m_microseconds_user +=

154 (ULong)( end_time_tick.tms_utime - start_time_tick.tms_utime )

155 * 1000000 / /*BUGBUG_NT*/(ULong)/*sysconf*/idlOS::sysconf/*BUGBUG_NT*/( _SC_CLK_TCK );

156 /* Compute system clock time */

157 m_microseconds_system +=

config.h.in (https://github.com/timon/MacRuby.git) Autoconf · 234 lines

222 #define FILE_COUNT _r

223 #define FILE_READPTR _p

224 #define HAVE__SC_CLK_TCK 1

225 #define STACK_GROW_DIRECTION -1

226 #define _REENTRANT 1

hrtimer.cpp (https://gitlab.com/cdeclare/intcrypt) C++ · 142 lines

133 return 10*1000*1000;

134 #elif defined(CRYPTOPP_UNIX_AVAILABLE)

135 static const long ticksPerSecond = sysconf(_SC_CLK_TCK);

136 return ticksPerSecond;

137 #else

tstopwatch.cpp (https://github.com/opentoonz/opentoonz.git) C++ · 402 lines

18 #ifndef _WIN32

19 extern "C" long sysconf(int);

20 #define STW_TICKS_PER_SECOND sysconf(_SC_CLK_TCK)

21 #else

22 #define STW_TICKS_PER_SECOND CLK_TCK

cpu_time.c (https://github.com/att14/ultraxomb.git) C · 137 lines

30 #if !defined (HAVE_GETRUSAGE) || !defined (HAVE_SYS_RESOURCE_H)

31 /* For times(), we _must_ know the number of clock ticks per second. */

32 # if defined (HAVE_TIMES) && (defined (HZ) || defined (_SC_CLK_TCK) || defined (CLK_TCK))

33 # ifdef HAVE_SYS_PARAM_H

34 # include <sys/param.h>

38 # endif

39 # ifndef HZ

40 # if defined _SC_CLK_TCK

41 # define HZ sysconf(_SC_CLK_TCK)

test_timer.cpp (https://github.com/homer6/import-geoip-data.git) C++ · 246 lines

156 #ifdef CLOCKS_PER_SEC

157 /* it looks like CLOCKS_PER_SEC should be defined on all platforms... just to feel safe.

158 Maybe use sysconf(_SC_CLK_TCK) */

159

160 return static_cast<float> (inWallClocks) / CLOCKS_PER_SEC;

os-util-test.cc (https://github.com/apache/kudu.git) C++ · 62 lines

43 ASSERT_OK(ParseStat(buf, &extracted_name, &stats));

44 ASSERT_EQ(name, extracted_name);

45 ASSERT_EQ(user_ticks * (1e9 / sysconf(_SC_CLK_TCK)), stats.user_ns);

46 ASSERT_EQ(kernel_ticks * (1e9 / sysconf(_SC_CLK_TCK)), stats.kernel_ns);

47 ASSERT_EQ(io_wait * (1e9 / sysconf(_SC_CLK_TCK)), stats.iowait_ns);

48 }

49

posixtime.h (https://github.com/liudidi/android_external_bash.git) C Header · 49 lines

37 #endif

38

39 #if !defined (HAVE_SYSCONF) || !defined (_SC_CLK_TCK)

40 # if !defined (CLK_TCK)

41 # if defined (HZ)

45 # endif

46 # endif /* !CLK_TCK */

47 #endif /* !HAVE_SYSCONF && !_SC_CLK_TCK */

48

49 #endif /* _POSIXTIME_H_ */

platform_freebsd.cc (https://github.com/GunioRobot/node.git) C++ · 210 lines

90 Local<Object> cpuinfo;

91 Local<Object> cputimes;

92 unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),

93 multiplier = ((uint64_t)1000L / ticks), cpuspeed, maxcpus,

94 cur = 0;

unistd.h (https://github.com/josephzizys/plan-9.git) C Header · 168 lines

54 #define _SC_ARG_MAX 1 /* max chars in args to exec */

55 #define _SC_CHILD_MAX 2 /* max child process per process */

56 #define _SC_CLK_TCK 3 /* number of clock() units per second */

57 #define _SC_NGROUPS_MAX 4 /* max supplementary groups per process */

58 #define _SC_OPEN_MAX 5

CpuFreqParser.cpp (https://gitlab.com/SkyDragon-OSP/platform_frameworks_base) C++ · 90 lines

62 ProtoOutputStream proto;

63

64 long jiffyHz = sysconf(_SC_CLK_TCK);

65 proto.write(CpuFreqProto::JIFFY_HZ, (int)jiffyHz);

66

sysconf.c (https://github.com/cpc26/abi_linux.git) C · 189 lines

51 #define _SC_ARG_MAX 0

52 #define _SC_CHILD_MAX 1

53 #define _SC_CLK_TCK 2

54 #define _SC_NGROUPS_MAX 3

55 #define _SC_OPEN_MAX 4

151 return (CHILD_MAX);

152

153 case _SC_CLK_TCK:

154 return (HZ);

155

system.h (https://github.com/GNA-SERVICES-INC/MoNGate.git) C Header · 105 lines

95

96 #ifndef HAVE_SYSCONF

97 #define _SC_CLK_TCK 2

98 long sysconf(int) __attribute__((__noreturn__));

99 #endif

time.h (https://github.com/metricinc/illumos-gate.git) C Header · 87 lines

58 */

59 extern long sysconf(/* int name */);

60 #define _SC_CLK_TCK 3 /* clock ticks/sec */

61 /*

62 * POSIX.1 uses CLK_TCK to specify units used by times(3).

64 * we'll probably have to support it for a long time.

65 */

66 #define CLK_TCK (sysconf(_SC_CLK_TCK))

67 /* 881207 ANSI C draft uses CLOCKS_PER_SEC to specify units used by clock(3). */

68 #define CLOCKS_PER_SEC 1000000L

freq-step.c (https://github.com/bergwolf/linux.git) C · 263 lines

220 mono_base = ts.tv_sec;

221

222 user_hz = sysconf(_SC_CLK_TCK);

223

224 precision = get_sample(&sample) / 2.0;

cputimer.cc (https://github.com/estrai/xapian.git) C++ · 93 lines

65 t = (double)(b.tms_utime + b.tms_stime);

66 # ifdef HAVE_SYSCONF

67 t /= sysconf(_SC_CLK_TCK);

68 # else

69 t /= CLK_TCK;

time.h (https://gitlab.com/infected_/linaro_aarch64-linux-android-5.3.x) C Header · 101 lines

54 # include <bits/types.h>

55 extern long int __sysconf (int);

56 # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */

57 # endif

58

hrtimer.cpp (https://github.com/weidai11/cryptopp.git) C++ · 174 lines

165 return ticksPerSecond;

166 #elif defined(CRYPTOPP_UNIX_AVAILABLE)

167 static const long ticksPerSecond = sysconf(_SC_CLK_TCK);

168 return ticksPerSecond;

169 #else

gauss.c (https://github.com/adgllorente/university.git) C · 156 lines

71 * (tiempo en milisegundos entre dos ticks del temporizador)

72 * Se calcula a partir del nº de intervalos que el temporizador cuenta cada segundo.

73 * Para saber este n� de intervalos hay que usar la llamada sysconf(_SC_CLK_TCK).

74 * El programa realiza esta llamada e inicializa la variable timer_resolution.

75 */

76 intervalos = sysconf(_SC_CLK_TCK);

77 timer_resolution = 1000000.0/intervalos;

78

ibcs2_unistd.h (https://bitbucket.org/killerpenguinassassins/open_distrib_devel.git) C Header · 76 lines

51 #define IBCS2_SC_ARG_MAX 0

52 #define IBCS2_SC_CHILD_MAX 1

53 #define IBCS2_SC_CLK_TCK 2

54 #define IBCS2_SC_NGROUPS_MAX 3

55 #define IBCS2_SC_OPEN_MAX 4

timer.cc (git://pkgs.fedoraproject.org/mingw-w64-tools) C++ · 132 lines

59 }

60

61 #if HAVE_SYSCONF && defined _SC_CLK_TCK

62 # define TICKS_PER_SECOND sysconf (_SC_CLK_TCK) /* POSIX 1003.1-1996 */

tst-mutex5.c (https://github.com/nitinkamble/glibc.git) C · 202 lines

111 else

112 {

113 int clk_tck = sysconf (_SC_CLK_TCK);

114

115 gettimeofday (&tv2, NULL);

times.c (https://git.sr.ht/~emersion/mrsh/) C · 41 lines

17

18 struct tms buf;

19 long clk_tck = sysconf(_SC_CLK_TCK);

20 if (clk_tck == -1) {

21 perror("sysconf");

MemoryInfo.cc (https://bitbucket.org/MaxCam/anchordist.git) C++ · 129 lines

51 initMem = 0;

52 initTime = 0;

53 tickspersec = sysconf(_SC_CLK_TCK);

54 prevMem = initMem;

55 prevTime = initTime;

timer.c (https://bitbucket.org/bosp/benchmarks-parsec.git) C · 395 lines

53 #endif

54 #if !defined(CLK_TCK)

55 #define CLK_TCK sysconf(_SC_CLK_TCK)

56 #endif

57

SBB_util.cc (https://github.com/caymanson/financial_software_projects.git) C++ · 63 lines

5 #include "string.h"

6

7 static long Ticks_per_second = sysconf(_SC_CLK_TCK);

8

9 SBB_util::SBB_util()

OsHelperConstants.java (https://github.com/dstmath/HWFramework.git) Java · 91 lines

77 public static final int W_OK = OsConstants.W_OK;

78 public static final int X_OK = OsConstants.X_OK;

79 public static final int _SC_CLK_TCK = OsConstants._SC_CLK_TCK;

80

81 private OsHelperConstants() {

unistd.hpp (https://github.com/hpcdev/xylose.git) C++ Header · 113 lines

70

71

72 static const int _SC_CLK_TCK = 1;

73

74 inline long sysconf(int name) {

75 switch (name) {

76 case _SC_CLK_TCK:

77 return CLOCKS_PER_SEC;

78 break;

TStopwatch.cxx (git://pkgs.fedoraproject.org/root) C++ · 255 lines

43 #ifdef R__UNIX

44 if (gTicks <= 0.0)

45 gTicks = (Double_t)sysconf(_SC_CLK_TCK);

46 #endif

47

LinuxProcessMonitor.cpp (https://bitbucket.org/arild/thesis) C++ · 426 lines

3 LinuxProcessMonitor::LinuxProcessMonitor()

4 {

5 _jiffy = sysconf(_SC_CLK_TCK);

6 _buffer = new char[300]; // size is 200 but we use 300 for future versions (ubuntu version for example has many more fields...)

7 memset(_buffer, 0, 300);

sysconf-consts.c (https://github.com/kayceesrk/multiMLton.git) C · 506 lines

41 #endif

42 const C_Int_t Posix_ProcEnv_SC_CHILD_MAX = _SC_CHILD_MAX;

43 #ifndef _SC_CLK_TCK

44 #define _SC_CLK_TCK -1

45 #endif

46 const C_Int_t Posix_ProcEnv_SC_CLK_TCK = _SC_CLK_TCK;

47 #ifndef _SC_COLL_WEIGHTS_MAX

48 #define _SC_COLL_WEIGHTS_MAX -1

timer.c (https://gitlab.com/jiapei100/ImageMagick) C · 477 lines

212 timer;

213

214 return((double) times(&timer)/sysconf(_SC_CLK_TCK));

215 #else

216 #if defined(MAGICKCORE_WINDOWS_SUPPORT)

467

468 (void) times(&timer);

469 return((double) (timer.tms_utime+timer.tms_stime)/sysconf(_SC_CLK_TCK));

470 #else

471 #if defined(MAGICKCORE_WINDOWS_SUPPORT)

perf_writer.c (https://bitbucket.org/knarf/samba.git) C · 213 lines

27 {

28 data->cpuInfo.numCPUs = sysconf(_SC_NPROCESSORS_ONLN) > 0 ? sysconf(_SC_NPROCESSORS_ONLN) : 1;

29 data->PerfFreq = sysconf(_SC_CLK_TCK);

30 init_mem_data(data);

31 init_cpu_data(data);

getruntime.c (https://github.com/GunioRobot/MI424WR_GEN2_Rev_E-F.git) C · 116 lines

66 #endif

67

68 #ifdef _SC_CLK_TCK

69 #define GNU_HZ sysconf(_SC_CLK_TCK)

clock_getres.c (https://github.com/nitinkamble/x32-glibc.git) C · 118 lines

60 realtime_getres (struct timespec *res)

61 {

62 long int clk_tck = sysconf (_SC_CLK_TCK);

63

64 if (__builtin_expect (clk_tck != -1, 1))

proc_stat_reader.cc (https://github.com/chromium/chromium.git) C++ · 142 lines

32

33 long GetClockTicksPerSecond() {

34 long clock_ticks_per_s = sysconf(_SC_CLK_TCK);

35 if (clock_ticks_per_s <= 0) {

36 PLOG(ERROR) << "sysconf";

unix-system-wall-clock-ms.cc (https://github.com/nyuwireless-unipd/ns3-mmwave.git) C++ · 194 lines

98 //

99 NS_LOG_FUNCTION (this);

100 static int64_t ticksPerSecond = sysconf (_SC_CLK_TCK);

101 static double millisecondsPerTick = 1000. / ticksPerSecond;

102

104 // If sysconf () fails, we have no idea how to do the required conversion to ms.

105 //

106 NS_ABORT_MSG_IF (ticksPerSecond == -1, "SystemWallClockMsPrivate(): Cannot sysconf (_SC_CLK_TCK)");

107

108 struct tms endTimes;

os-util.cc (https://gitlab.com/s9perween/Impala) C++ · 114 lines

32

33 // Ensure that Impala compiles on earlier kernels. If the target kernel does not support

34 // _SC_CLK_TCK, sysconf(_SC_CLK_TCK) will return -1.

35 #ifndef _SC_CLK_TCK

36 #define _SC_CLK_TCK 2

37 #endif

38

39 static const int64_t TICKS_PER_SEC = sysconf(_SC_CLK_TCK);

40

41 // Offsets into the ../stat file array of per-thread statistics

posix-test.c (https://github.com/linkdd/slightx.git) C · 719 lines

378 printf("POSIX.1 CHILD MAX Value=%d.\n",val);

379 }

380 val=sysconf(_SC_CLK_TCK);

381 if (val == -1)

382 {

383 printf("Bad option _SC_CLK_TCK\n");

384 }

385 else

timer.c (https://github.com/BlitzMaxModules/bah.mod.git) C · 415 lines

42 */

43 #if !defined(CLK_TCK)

44 #define CLK_TCK sysconf(_SC_CLK_TCK)

45 #endif

46

param.h (https://bitbucket.org/evzijst/gittest.git) C Header · 42 lines

35 /*

36 * Technically, this is wrong, but some old apps still refer to it. The proper way to

37 * get the HZ value is via sysconf(_SC_CLK_TCK).

38 */

39 # define HZ 1024

CPUTime.hs (http://picorec.googlecode.com/svn/trunk/) Haskell · 182 lines

44 {-# LINE 41 "libraries/base/./System/CPUTime.hsc" #-}

45

46 -- For _SC_CLK_TCK

47

48 {-# LINE 44 "libraries/base/./System/CPUTime.hsc" #-}

sys_clock_.c (https://github.com/avsm/src.git) C · 79 lines

53 if (count_rate)

54 {

55 #ifdef _SC_CLK_TCK

56 *count_rate = sysconf (_SC_CLK_TCK);

time.h (https://github.com/cznic/cc.git) C Header · 97 lines

53 # include <bits/types.h>

54 extern long int __sysconf(int);

55 # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */

56 # endif

57

schema.go (https://github.com/lesovsky/pgcenter.git) Go · 166 lines

31 AS $$

32 use POSIX;

33 $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );

34 return $clock_ticks;

35 $$;`

clock_getres.c (git://pkgs.fedoraproject.org/arm-gp2x-linux-glibc) C · 110 lines

41 #define HANDLE_REALTIME \

42 do { \

43 long int clk_tck = sysconf (_SC_CLK_TCK); \

44 \

45 if (__builtin_expect (clk_tck != -1, 1)) \

test_mapper.c (https://github.com/NCAR/lrose-core.git) C · 240 lines

69

70 if (clktck == 0) {

71 if ((clktck = sysconf(_SC_CLK_TCK)) < 0) {

72 fprintf(stderr, "Error getting clock tick constant\n");

73 clktck = 1;

sysconf.c (https://github.com/pikpik/Shlib4MINIX3.git) C · 76 lines

43 return (long) CHILD_MAX;

44

45 case _SC_CLK_TCK:

46 return (long) get_hz();

47

t40f.c (https://gitlab.com/storedmirrors/minix) C · 193 lines

165

166 /* Retrieve actual system frequency. */

167 system_hz = sysconf(_SC_CLK_TCK);

168 /* Get subtest number */

169 if(argc != 2) {

vul_timer.cxx (https://bitbucket.org/jtotz/vxl) C++ · 200 lines

69 #endif

70 #undef CLK_TCK

71 #define CLK_TCK sysconf(_SC_CLK_TCK)

72

73 vul_timer::vul_timer()

Sysconf.java (https://github.com/finco/jnr-constants.git) Java · 143 lines

5 _SC_ARG_MAX,

6 _SC_CHILD_MAX,

7 _SC_CLK_TCK,

8 _SC_NGROUPS_MAX,

9 _SC_OPEN_MAX,

test-times.c (https://gitlab.com/Ntemis/wive-ng-mt) C · 105 lines

44 struct tms tms;

45 clock_t t;

46 #ifndef _SC_CLK_TCK

47 clock_t clk_tck = CLK_TCK;

48 #else

49 clock_t clk_tck = sysconf (_SC_CLK_TCK);

50 #endif

51

Timer.h (https://github.com/lolow/oboe-fix.git) C Header · 74 lines

40

41 public:

42 Timer() : _clockTicks(sysconf(_SC_CLK_TCK)) {}

43 inline void start() { _startClock = times(&_startTime); }

44 inline void stop() { _endClock = times(&_endTime); }

times.rb (https://github.com/mingle/oauth2_provider.git) Ruby · 36 lines

4 module Process

5 class Foreign

6 SC_CLK_TCK = com.kenai.constantine.platform.Sysconf::_SC_CLK_TCK.value

7

8 extend FFI::Library

test.c (https://repo.or.cz/barvinok.git) C · 254 lines

15 static void time_diff(struct tms *before, struct tms *after)

16 {

17 long ticks = sysconf(_SC_CLK_TCK);

18 printf("User: %g; Sys: %g\n",

19 (0.0 + after->tms_utime - before->tms_utime) / ticks,

util.c (https://github.com/beekhof/libqb.git) C · 369 lines

198 qb_util_nano_monotonic_hz(void)

199 {

200 return sysconf(_SC_CLK_TCK);

201 }

202

timeu.c (https://bitbucket.org/dpgrote/pygist.git) C · 71 lines

41 # include <unistd.h>

42 # ifndef CLK_TCK

43 # define CLK_TCK sysconf(_SC_CLK_TCK)

44 # endif

45 # endif

time.c (https://bitbucket.org/gthummalapalle/minix-project2.git) C · 187 lines

134 u32_t system_hz;

135

136 system_hz = (u32_t) sysconf(_SC_CLK_TCK);

137

138 digit_seen = 0;

times.c (https://gitlab.com/vascocosta/os) C · 184 lines

105 //

106

107 ClockTicksPerSecond = sysconf(_SC_CLK_TCK);

108 if (ClockTicksPerSecond == -1) {

109 return -1;

8-1.c (https://github.com/yourpalal/haiku.git) C · 236 lines

126 }

127 }

128 while ( ( cur_time - st_time ) < sysconf( _SC_CLK_TCK ) );

129

130 #if VERBOSE > 1

136 ( long ) ( parent_tms.tms_utime - ini_tms.tms_utime ),

137 ( long ) ( parent_tms.tms_stime - ini_tms.tms_stime ),

138 sysconf( _SC_CLK_TCK ) );

139

140 #endif

159 }

160

161 if ( child_tms.tms_utime + child_tms.tms_stime >= sysconf( _SC_CLK_TCK ) )

162 {

163 FAILED( "The tms struct was not reset during fork() operation" );

test-benchmark.c (https://gitlab.com/4144/gcc) C · 268 lines

207 /* Taken from timevar.c. */

208 static double ticks_to_msec;

209 #define TICKS_PER_SECOND sysconf (_SC_CLK_TCK) /* POSIX 1003.1-1996 */

210 #define TICKS_TO_MSEC (1 / (double)TICKS_PER_SECOND)

211 static double get_wallclock_time (void)

Unistd.java (https://github.com/oracle/graal.git) Java · 131 lines

64

65 @CConstant

66 public static native int _SC_CLK_TCK();

67

68 @CConstant

netkit-rusers-0.17-procps.patch (git://pkgs.fedoraproject.org/rusers) Patch · 101 lines

39 + char *savelocale;

40

41 hz = sysconf(_SC_CLK_TCK);

42 gettimeofday(&tm, (struct timezone *) 0);

43

demo_sched_fifo.c (https://gitlab.com/Gentio/my-pdf) C · 102 lines

31 errExit("times");

32 cpuCentisecs = (tms.tms_utime + tms.tms_stime) * 100 /

33 sysconf(_SC_CLK_TCK);

34

35 if (cpuCentisecs >= prevStep + CSEC_STEP) {

dsniff-2.4-sysconf_clocks.patch (git://github.com/repoforge/rpms.git) Patch · 27 lines ✨ Summary

This patch code updates the sshow.c file to fix a clock issue, allowing it to work with older Linux kernel versions. It adds a check for the _SC_CLK_TCK constant and uses its value if defined, ensuring compatibility with different system configurations. The changes are made in two locations within the sshow.c file.

9 clock_t delay;

10 int payload;

11 +#if defined(_SC_CLK_TCK)

12 + long CLK_TCK = sysconf(_SC_CLK_TCK);

19 int skip;

20 range string_range;

21 +#if defined(_SC_CLK_TCK)

22 + long CLK_TCK = sysconf(_SC_CLK_TCK);

HPL_timer_cputime.c (https://bitbucket.org/vbui/cs533-project) C · 163 lines

104 static double ClockTick = HPL_rzero;

105

106 if( ClockTick == HPL_rzero ) ClockTick = (double)(sysconf(_SC_CLK_TCK));

107 (void) times( &ts );

108 return( (double)(ts.tms_utime) / ClockTick );

sysconf.c (https://bitbucket.org/pizzafactory/blackfin-toolchain.git) C · 383 lines

50 #endif

51

52 case _SC_CLK_TCK:

53 return CLK_TCK;

54

cpu.c (git://pkgs.fedoraproject.org/libgtop2) C · 136 lines

131

132

133 buf->frequency = sysconf(_SC_CLK_TCK);

134 buf->flags = _glibtop_sysdeps_cpu;

135 }

uptime.c (https://github.com/Shmuma/z.git) C · 120 lines

79 init_result(result);

80

81 hz = sysconf(_SC_CLK_TCK);

82

83 /* open kstat */

etime_.c (https://github.com/avsm/src.git) C · 160 lines

135 struct tms buffer;

136

137 /* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf;

138 fixme: does using _POSIX_VERSION help? */

139 # if defined _SC_CLK_TCK && defined _POSIX_VERSION

140 if (! clk_tck) clk_tck = sysconf(_SC_CLK_TCK);

141 # elif defined CLOCKS_PER_SECOND

142 if (! clk_tck) clk_tck = CLOCKS_PER_SECOND;

gethrtime.c (https://github.com/Qthreads/qthreads.git) C · 60 lines

36 double qtimer_res(void)

37 {

38 #if defined(HAVE_SYSCONF) && defined(HAVE_SC_CLK_TCK)

39 return 1.0 / sysconf(_SC_CLK_TCK);;

t_initialize.c (https://gitlab.com/martinsingh/SAM) C · 292 lines

87 */

88

89 if ((ticks_per_sec = sysconf (_SC_CLK_TCK)) == -1)

90 return t_error ("t_initialize: token _SC_CLK_TCK is not defined\n");

Timer.cpp (https://github.com/paypal/hera.git) C++ · 310 lines

25 {

26 // Right here, it shows the problem with using '_' before identifier. It is reserved!

27 static long clk_tck = ::sysconf(_SC_CLK_TCK);

28 ASSERT( clk_tck > 0 );

29

35 {

36 // Right here, it shows the problem with using '_' before identifier. It is reserved!

37 static long clk_tck = ::sysconf(_SC_CLK_TCK);

38 ASSERT( clk_tck > 0 );

39

Time_Posix.ipp (https://github.com/Mysticial/y-cruncher.git) C++ Header · 122 lines

55 out.wall_clock = WallClock::Now();

56

57 static double ratio = 1. / sysconf(_SC_CLK_TCK);

58

59 struct tms timers;

timer_nrp.c (https://bitbucket.org/tbindi/bubble-sort-vs-quick-sort.git) C · 57 lines

15 {

16 real1 = times(&tbuf1);

17 clock_ticks = sysconf(_SC_CLK_TCK);

18 return;

19 }

8-1.c (https://github.com/barajas/Intel-GLTP.git) C · 184 lines

99 if (cur_time == (clock_t) -1)

100 UNRESOLVED(errno, "times failed");

101 } while ((cur_time - st_time) < sysconf(_SC_CLK_TCK));

102

103 #if VERBOSE > 1

107 (long) (parent_tms.tms_utime - ini_tms.tms_utime),

108 (long) (parent_tms.tms_stime - ini_tms.tms_stime),

109 sysconf(_SC_CLK_TCK));

110 #endif

111

124 UNRESOLVED(errno, "times failed");

125

126 if ((child_tms.tms_utime + child_tms.tms_stime) >= sysconf(_SC_CLK_TCK))

127 FAILED("The tms struct was not reset during fork "

128 "operation");

config.h (git://github.com/funkaster/shinycocos.git) C Header · 186 lines

171 #define FILE_READPTR _p

172 #define NEED_IO_SEEK_BETWEEN_RW 1

173 #define HAVE__SC_CLK_TCK 1

174 #define STACK_GROW_DIRECTION -1

175 #define DEFAULT_KCODE KCODE_NONE

functions.c (https://gitlab.com/dtluna/Course) C · 223 lines

94 &utime, &stime);

95 fclose_err(fclose(stat_file));

96 time_t proc_time = ((utime+stime)/sysconf(_SC_CLK_TCK));

97 return proc_time;

98 }

121 fclose_err(fclose(cpu_stat_file));

122

123 time_t cpu_time = (user+nice+system_time+idle)/sysconf(_SC_CLK_TCK);

124

125 return cpu_time;

superlu_timer.c (https://github.com/jsilter/scipy.git) C · 72 lines

60 struct tms use;

61 double tmp;

62 int clocks_per_sec = sysconf(_SC_CLK_TCK);

63

64 times ( &use );

time_.h (https://github.com/josephzizys/plan-9.git) C Header · 95 lines

82 # define use_times_for_usertime 1

83 /* Posix 1003.1b-1993 section 4.8.1.5 says that

84 CLK_TCK is obsolescent and that sysconf(_SC_CLK_TCK)

85 should be used instead, but this requires including

86 <unistd.h>, which is too painful to configure. */

acct_view.c (https://gitlab.com/Gentio/my-pdf) C · 98 lines

87

88 printf("%5.2f %7.2f ", (double) (comptToLL(ac.ac_utime) +

89 comptToLL(ac.ac_stime)) / sysconf(_SC_CLK_TCK),

90 (double) comptToLL(ac.ac_etime) / sysconf(_SC_CLK_TCK));

fh_sysmon.c (https://github.com/csinitiative/fhce.git) C · 258 lines

97 */

98 if (cpu_count == 0) {

99 clock_rate = sysconf(_SC_CLK_TCK);

100 cpu_count = sysconf(_SC_NPROCESSORS_CONF);

101 }

31_sysconf_clocks.patch (https://gitlab.com/abchk1234/slackbuilds) Patch · 31 lines

12 clock_t delay;

13 int payload;

14 - long CLK_TCK= sysconf(_SC_CLK_TCK);

15 +#if defined(_SC_CLK_TCK)

16 + long CLK_TCK = sysconf(_SC_CLK_TCK);

17 +#endif

18

23 int skip;

24 range string_range;

25 - long CLK_TCK= sysconf(_SC_CLK_TCK);

26 +#if defined(_SC_CLK_TCK)

27 + long CLK_TCK = sysconf(_SC_CLK_TCK);

28 +#endif

29

sys_time.c (https://github.com/dustin/otp.git) C · 134 lines

38 # define TICKS_PER_SEC() HZ

39 #else

40 #define TICKS_PER_SEC() sysconf(_SC_CLK_TCK)

41 #endif

42

index.c (https://github.com/peper/pizza.git) C · 245 lines

27 // first creates a full trie T

28 #ifdef INDEXREPORT

29 ticks= sysconf(_SC_CLK_TCK);

30 times(&time); t1 = time.tms_utime;

31 printf (" Building LZTrie...\n"); fflush(stdout);