henesyinit from p9fd787fda5 years agoHistory
26 lines · 321 B · C
RawDownload
#include <u.h>#include <libc.h> static Lock tlock; longtime(long *tp){	char b[20];	static int f = -1;	long t; 	lock(&tlock);	memset(b, 0, sizeof(b));	f = open("/dev/time", OREAD|OCEXEC);	if(f >= 0) {		seek(f, 0, 0);		read(f, b, sizeof(b));	}	t = atol(b);	if(tp)		*tp = t;	unlock(&tlock); 	return t;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t