Download mosesdecoder/moses2/legacy/Timer.h from sleepyhead111/vllm_fairseq: direct link, hf CLI and curl.
- Browser
- Download file 791 Bytes
-
https://huggingface.co/sleepyhead111/vllm_fairseq/resolve/main/mosesdecoder/moses2/legacy/Timer.h
- Command line
-
hf download hf://sleepyhead111/vllm_fairseq/mosesdecoder/moses2/legacy/Timer.h
-
curl -L -o Timer.h https://huggingface.co/sleepyhead111/vllm_fairseq/resolve/main/mosesdecoder/moses2/legacy/Timer.h
791 Bytes
| namespace Moses2 | |
| { | |
| /** Wrapper around time_t to time how long things have been running | |
| * according to walltime. We avoid CPU time since it is less reliable | |
| * in a multi-threaded environment and can spuriously include clock cycles | |
| * used by other threads in the same process. | |
| */ | |
| class Timer | |
| { | |
| friend std::ostream& operator<<(std::ostream& os, Timer& t); | |
| private: | |
| bool running; | |
| bool stopped; | |
| double start_time; | |
| double stop_time; | |
| public: | |
| /*** | |
| * 'running' is initially false. A timer needs to be explicitly started | |
| * using 'start' | |
| */ | |
| Timer(); | |
| void start(const char* msg = 0); | |
| void stop(const char* msg = 0); | |
| void check(const char* msg = 0); | |
| double get_elapsed_time() const; | |
| }; | |
| } | |