MCPcopy Create free account
hub / github.com/Singular/Singular / getTimer

Function getTimer

kernel/oswrapper/timer.cc:80–91  ·  view source on GitHub ↗

2 * returns the time since a fixed point in seconds */

Source from the content-addressed store, hash-verified

78* returns the time since a fixed point in seconds
79*/
80long getTimer()
81{
82 int64 curr;
83 getrusage(RUSAGE_SELF,&t_rec);
84 curr = (int64)t_rec.ru_utime.tv_sec*1000000+(int64)t_rec.ru_utime.tv_usec
85 +(int64)t_rec.ru_stime.tv_sec*1000000+(int64)t_rec.ru_stime.tv_usec;
86 getrusage(RUSAGE_CHILDREN,&t_rec);
87 curr += (int64)t_rec.ru_utime.tv_sec*1000000+(int64)t_rec.ru_utime.tv_usec
88 +(int64)t_rec.ru_stime.tv_sec*1000000+(int64)t_rec.ru_stime.tv_usec;
89 double f = ((double)curr) * timer_resolution / (double)1000000;
90 return (long)(f+0.5);
91}
92
93/*2
94* stops timer, writes string s and the time since last call of startTimer

Callers 2

DataMethod · 0.85
F5mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected