Internal change

PiperOrigin-RevId: 522339052
Change-Id: I442c99cf1823f79b763c24f446ec6131dcfc3e77
diff --git a/lapack/dsecnd.c b/lapack/dsecnd.c
deleted file mode 100644
index d74f8053..0000000
--- a/lapack/dsecnd.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "blaswrap.h"
-#include "f2c.h"
-#include <sys/times.h>
-#include <sys/types.h>
-#include <time.h>
-
-#ifndef CLK_TCK
-#define CLK_TCK 60
-#endif
-
-doublereal dsecnd_()
-{
-  struct tms rusage;
-
-  times(&rusage);
-  return (doublereal)(rusage.tms_utime) / CLK_TCK;
-
-} /* dsecnd_ */
diff --git a/lapack/dsecnd.cpp b/lapack/dsecnd.cpp
new file mode 100644
index 0000000..b046955
--- /dev/null
+++ b/lapack/dsecnd.cpp
@@ -0,0 +1,11 @@
+#include <ctime>
+
+extern "C" {
+double dsecnd_();
+}
+
+// Elapsed CPU Time in seconds.
+double dsecnd_() {
+  return static_cast<double>(std::clock()) /
+         static_cast<double>(CLOCKS_PER_SEC);
+}
diff --git a/lapack/second.c b/lapack/second.c
deleted file mode 100644
index 33c7dde..0000000
--- a/lapack/second.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "f2c.h"
-#include <sys/times.h>
-#include <sys/types.h>
-#include <time.h>
-
-#ifndef CLK_TCK
-#define CLK_TCK 60
-#endif
-
-doublereal second_()
-{
-  struct tms rusage;
-
-  times(&rusage);
-  return (doublereal)(rusage.tms_utime) / CLK_TCK;
-
-} /* second_ */
diff --git a/lapack/second.cpp b/lapack/second.cpp
new file mode 100644
index 0000000..faa6187
--- /dev/null
+++ b/lapack/second.cpp
@@ -0,0 +1,11 @@
+#include <ctime>
+
+extern "C" {
+double second_();
+}
+
+// Elapsed CPU Time in seconds.
+double second_() {
+  return static_cast<double>(std::clock()) /
+         static_cast<double>(CLOCKS_PER_SEC);
+}
\ No newline at end of file