| 175 | { |
| 176 | QiFunc_time_ms() : QiFunc(0, 4) {} |
| 177 | QiVar exec(const std::vector<QiVar>& args, QiScriptInterpreter*) const override |
| 178 | { |
| 179 | if (args.empty()) return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(); |
| 180 | return TimeToMs(args[0].toInteger(), |
| 181 | args.size() > 1 ? args[1].toInteger() : 0, |
| 182 | args.size() > 2 ? args[2].toInteger() : 0, |
| 183 | args.size() > 3 ? args[3].toInteger() : 0 |
| 184 | ); |
| 185 | } |
| 186 | }; |
| 187 | /* |
| 188 | int timestamp: sec |