grpc/include/protoc.h
2024-12-09 19:29:55 +08:00

27 lines
671 B
C++

#pragma once
#include <grpc/grpc.h>
#include <grpcpp/security/server_credentials.h>
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
#include "market_data.grpc.pb.h"
using grpc::Server;
using grpc::ServerBuilder;
using grpc::ServerContext;
using grpc::ServerReader;
using grpc::ServerReaderWriter;
using grpc::ServerWriter;
using grpc::Status;
inline long GetTimeUs() {
// 获取当前时间点
auto now = std::chrono::high_resolution_clock::now();
// 将时间点转换为微秒
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
now.time_since_epoch());
return duration.count();
}