Skip to content

Commit 07566f5

Browse files
committed
bazel does not like gettimeofday either
1 parent c5d7dcc commit 07566f5

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/pdlp/cupdlp/cupdlp_utils.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,45 +1137,45 @@ void PDHG_Destroy(CUPDLPwork **w) {
11371137

11381138
void PDHG_Init_Data(CUPDLPwork *work) {}
11391139

1140-
double my_clock(void) {
1141-
1142-
#ifdef CUPDLP_TIMER
1143-
1144-
#if defined(_WIN32) || defined(_WIN64)
1145-
return (double)clock() / CLOCKS_PER_SEC;
1146-
#else
1147-
struct timeval t;
1148-
gettimeofday(&t, NULL);
1149-
return (1e-06 * t.tv_usec + t.tv_sec);
1150-
#endif
1151-
1152-
#else
1153-
return 0;
1154-
#endif
1155-
1156-
}
1157-
1158-
11591140
// double my_clock(void) {
1141+
11601142
// #ifdef CUPDLP_TIMER
1161-
// // struct timeval t;
1162-
// // clock_gettime(&t, NULL);
1163-
// // gettimeofday(&t, NULL);
1164-
// double timeee = 0;
11651143

1166-
// #ifndef WIN32
1167-
// timeee = time(NULL);
1144+
// #if defined(_WIN32) || defined(_WIN64)
1145+
// return (double)clock() / CLOCKS_PER_SEC;
11681146
// #else
1169-
// timeee = clock();
1147+
// struct timeval t;
1148+
// gettimeofday(&t, NULL);
1149+
// return (1e-06 * t.tv_usec + t.tv_sec);
11701150
// #endif
11711151

1172-
// return timeee;
1173-
// // return (1e-06 * t.tv_usec + t.tv_sec);
11741152
// #else
11751153
// return 0;
11761154
// #endif
1155+
11771156
// }
11781157

1158+
1159+
double my_clock(void) {
1160+
#ifdef CUPDLP_TIMER
1161+
// struct timeval t;
1162+
// clock_gettime(&t, NULL);
1163+
// gettimeofday(&t, NULL);
1164+
double timeee = 0;
1165+
1166+
#ifndef WIN32
1167+
timeee = time(NULL);
1168+
#else
1169+
timeee = clock();
1170+
#endif
1171+
1172+
return timeee;
1173+
// return (1e-06 * t.tv_usec + t.tv_sec);
1174+
#else
1175+
return 0;
1176+
#endif
1177+
}
1178+
11791179
double getTimeStamp(void) { return my_clock(); }
11801180

11811181
void dense_copy(CUPDLPdense *dst, CUPDLPdense *src) {

0 commit comments

Comments
 (0)