Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102416318
timer.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 20, 12:16
Size
473 B
Mime Type
text/x-c
Expires
Sat, Feb 22, 12:16 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24352408
Attached To
R1448 Lenstool-HPC
timer.h
View Options
#pragma once
//
#include <sys/time.h>
extern
"C"
{
double
myseconds
()
{
struct
timeval
tp
;
struct
timezone
tzp
;
//
int
i
=
gettimeofday
(
&
tp
,
&
tzp
);
//
return
(
(
double
)
tp
.
tv_sec
+
(
double
)
tp
.
tv_usec
*
1.e-6
);
}
}
#ifndef __xlC__
static
inline
unsigned
long
long
cycles
()
{
unsigned
long
long
u
;
__asm__
volatile
(
"rdtscp;shlq $32,%%rdx;orq %%rdx,%%rax;movq %%rax,%0"
:
"=q"
(
u
)
::
"%rax"
,
"%rdx"
,
"rcx"
);
return
u
;
}
#endif
Event Timeline
Log In to Comment