Skip to content

Commit

Permalink
Add in executable a lambda to test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Sep 11, 2023
1 parent 5662ec2 commit 2fdb602
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ortools/math_opt/samples/mathopt_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

// Check MathOpt available solvers.
#include <iostream>
#include <functional>

#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
Expand All @@ -23,6 +24,9 @@
#include "ortools/math_opt/core/solver_interface.h"
//#include "ortools/math_opt/cpp/enums.h"

#include <chrono>
#include <thread>

namespace {

struct SolverTypeProtoFormatter {
Expand All @@ -33,11 +37,26 @@ struct SolverTypeProtoFormatter {
}
};

void* const kRegisterSolver = [] {
std::cerr << "registering " << "PLOP" << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(500));
std::cerr << "registering " << "PLOP" << "...DONE" << std::endl;
return nullptr;
}();

} // namespace

int main(int argc, char* argv[]) {
using namespace std::chrono_literals;

InitGoogle(argv[0], &argc, &argv, /*remove_flags=*/true);

std::cerr << "sleeping\n";
// Thread delayed for 1 seconds
std::this_thread::sleep_for(1000ms);
//std::this_thread::sleep_for(std::chrono::milliseconds(5000));
std::cerr << "sleeping...DONE\n";

std::cout <<
absl::StrCat(
"the solver to use, possible values: ",
Expand Down

0 comments on commit 2fdb602

Please sign in to comment.