import java.text.SimpleDateFormat
import java.util.Date val s=NowDate() //显示当前的具体时间
val now=new Date() {
你的Spark程序........
} val now2: Date=new Date() val now3=now2.getTime -now.getTime val dateFormat: SimpleDateFormat = new SimpleDateFormat("mm:ss") val date = dateFormat.format(now3) //此为获取到的时间差 def NowDate(): String = {
val now: Date = new Date()
val dateFormat: SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
val date = dateFormat.format(now)
return date }

结果:

NowDate:结果类似为:2017-10-12 20:14:57
14:57
15:03
00:06   (差值结果)

Spark中统计程序运行时间的更多相关文章

  1. 在 Linux 如何优雅的统计程序运行时间?恕我直言,你运行的可能是假 time

    最近在使用 time 命令时,无意间发现了一些隐藏的小秘密和强大功能,今天分享给大家. time 在 Linux 下是比较常用的命令,可以帮助我们方便的计算程序的运行时间,对比采用不同方案时程序的运行 ...

  2. VC中监测程序运行时间(二)-毫秒级

    /* * 微秒级计时器,用来统计程序运行时间 * http://blog.csdn.net/hoya5121/article/details/3778487#comments * //整理 [10/1 ...

  3. java中读取程序运行时间

    第一种是以毫秒为单位计算的. Java代码 //伪代码 long startTime=System.currentTimeMillis();   //获取开始时间 doSomeThing();  // ...

  4. Java统计程序运行时间

    代码如下: 第一种是以毫秒为单位计算的. long startTime = System.currentTimeMillis();    //获取开始时间 doSomething();    //测试 ...

  5. SPARK 数据统计程序性能优化。

    昨天写完R脚本 没测试就发到博客里, 结果实际运行发现很慢,运行时间在2小时以上, 查看spark控制台, 大量时间消耗在count上, 产生的stage多大70多个 . 分析原因. 1  selec ...

  6. linux 统计 程序 运行时间

    测试 代码运行时间 linux 中的 <sys/time.h> 中 有个函数可以获取当前时间,精确到 微秒 ---->  gettimeofday() #include <sy ...

  7. C++统计程序运行时间代码片段

    因为经常需要统计代码的运行时间,所以计时功能就显得很重要, 记录一下现在喜欢用的计时方式,供日后查阅. 1.下面是计时主函数, bool TimeStaticMine(int id,const cha ...

  8. ARTS-S c语言统计程序运行时间

    #include <stdio.h> #include <sys/time.h> #include <unistd.h> int main() { struct t ...

  9. linux下统计程序/函数运行时间(转)

    一. 使用time 命令 例如编译一个hello.c文件 #gcc hello.c -o hello 生成了hello可执行文件,此时统计该程序的运行时间便可以使用如下命令 #time ./hello ...

随机推荐

  1. 15Ajax、JSON

    15Ajax.JSON-2018/07/27 1. ThreadLocal 总结:调用该类的get方法,永远返回当前线程放入的数据.线程局部变量. 保证线程安全 (第二阶段day14后半部分视频以及1 ...

  2. 如何用纯 CSS 创作一个按钮文字滑动特效

    效果预览 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. 在线预览 https://codepen.io/zhang-ou/pen/GdpPLE 可交互视频教 ...

  3. C#创建excel并释放资源

    using System; using Microsoft.Office.Interop.Excel; using Excel = Microsoft.Office.Interop.Excel; us ...

  4. textbook references

    * math 1. Teubner-Taschenbuch der Mathematik * CFD

  5. spring 学习(二)

    public interface BeanPostProcessor { @Nullable default Object postProcessBeforeInitialization(Object ...

  6. Spring 获取当前activeProfile

    WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext()) ...

  7. 【DIP, 图像增强】

    第四章 图像增强 图像增强是按特定的需要突出一幅图像中的某些信息,同时削弱或者去除某些不需要的信息的处理方法.其主要目的是使处理后的图像对某种特定的应用来说,比原始图像更加适用.因此这类处理是为了某种 ...

  8. [luoguP3690] 【模板】Link Cut Tree

    传送门 处理路径 xor 和的时候可以维护子树 xor 和,先提取出路径,再把一个点 splay 到最上方,直接取子树 xor 和即可. 更新一个点权时可以先提取出根到这个点的路径,把这个点 spla ...

  9. [luoguP2863] [USACO06JAN]牛的舞会The Cow Prom(Tarjan)

    传送门 有向图,找点数大于1的强连通分量个数 ——代码 #include <stack> #include <cstdio> #include <cstring> ...

  10. hdu 2545 并查集 树上战争

    #include<stdio.h> #include<string.h> #define N 110000 struct node {     int father,count ...