getTimeStamp function

int getTimeStamp({
  1. bool isSecond = false,
})

获取当前时间戳(Millisecond)

Implementation

int getTimeStamp({bool isSecond = false}) {
  int timestamp = DateTime.now().millisecondsSinceEpoch;
  if (isSecond) {
    timestamp = timestamp ~/ 1000;
  }
  return timestamp;
}