Import Upstream version 20180207
[hcoop/debian/mlton.git] / runtime / basis / System / Time.c
CommitLineData
7f918cf1
CE
1#include "platform.h"
2
3C_Int_t Time_getTimeOfDay (Ref(C_Time_t) sec, Ref(C_SUSeconds_t) usec) {
4 struct timeval timeval;
5 int res;
6 res = gettimeofday (&timeval, (struct timezone*)NULL);
7 if (! res) {
8 *((C_Time_t*)sec) = timeval.tv_sec;
9 *((C_SUSeconds_t*)usec) = timeval.tv_usec;
10 }
11 return res;
12}