forked from xxq250/Nasal-Interpreter
⚡ optimize codes. details:
1. delete gc::builtin_alloc 2. add convenient way of getting new string object: gc::newstr, and shrink the size of codes 3. update doc 4. add gc::temp to be used in native/module functions to avoid being recognized as garbage incorrectly when triggered mark-sweep
This commit is contained in:
7
main.cpp
7
main.cpp
@@ -109,11 +109,10 @@ void execute(const std::string& file,const std::vector<std::string>& argv,const
|
||||
}
|
||||
else if(cmd&VM_EXECTIME)
|
||||
{
|
||||
timeb begin,end;
|
||||
ftime(&begin);
|
||||
auto start=std::chrono::high_resolution_clock::now();
|
||||
vm.run(gen,linker,argv,cmd&VM_OPCALLNUM,cmd&VM_DBGINFO);
|
||||
ftime(&end);
|
||||
std::cout<<"process exited after "<<((end.time-begin.time)*1.0+end.millitm/1000.0-begin.millitm/1000.0)<<"s.\n";
|
||||
auto end=std::chrono::high_resolution_clock::now();
|
||||
std::cout<<"process exited after "<<(end-start).count()*1.0/std::chrono::high_resolution_clock::duration::period::den<<"s.\n";
|
||||
}
|
||||
else if(cmd&VM_EXEC)
|
||||
vm.run(gen,linker,argv,cmd&VM_OPCALLNUM,cmd&VM_DBGINFO);
|
||||
|
||||
Reference in New Issue
Block a user