about summary refs log blame commit diff
path: root/third_party/nix/src/libexpr/function-trace.cc
blob: 2bc0d943f33942e64a6f7e7e88f61b17b18d7949 (plain) (tree)
1
2
3
4
5
6
7
8



                            



                                                                               


                                         


                                                                               

 
                   
#include "function-trace.hh"

namespace nix {

FunctionCallTrace::FunctionCallTrace(const Pos& pos) : pos(pos) {
  auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
  auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(duration);
  printMsg(lvlInfo, "function-trace entered %1% at %2%", pos, ns.count());
}

FunctionCallTrace::~FunctionCallTrace() {
  auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
  auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(duration);
  printMsg(lvlInfo, "function-trace exited %1% at %2%", pos, ns.count());
}

}  // namespace nix