From ab3c9649c6bab5a8839970a11d5158369e95a8e2 Mon Sep 17 00:00:00 2001 From: groot Date: Wed, 5 Jun 2019 12:29:31 +0800 Subject: [PATCH] search context id Former-commit-id: 7e8bafac6b78d879edb8a09cd2ffb83c46d44401 --- cpp/src/db/scheduler/SearchContext.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cpp/src/db/scheduler/SearchContext.cpp b/cpp/src/db/scheduler/SearchContext.cpp index 51f523bf70..7cde55f31a 100644 --- a/cpp/src/db/scheduler/SearchContext.cpp +++ b/cpp/src/db/scheduler/SearchContext.cpp @@ -6,7 +6,8 @@ #include "SearchContext.h" #include "utils/Log.h" -#include + +#include namespace zilliz { namespace vecwise { @@ -17,9 +18,9 @@ SearchContext::SearchContext(uint64_t topk, uint64_t nq, const float* vectors) nq_(nq), vectors_(vectors) { //use current time to identify this context - time_t t; - time(&t); - identity_ = std::to_string(t); + std::chrono::system_clock::time_point tp = std::chrono::system_clock::now(); + long id = tp.time_since_epoch().count(); + identity_ = std::to_string(id); } bool